curl --request POST \
--url https://api.ttapi.io/v1/responses \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.4-mini",
"input": "Explain quantum computing in simple terms.",
"instructions": "<string>",
"previous_response_id": "<string>",
"conversation": "<string>",
"background": false,
"include": [],
"max_output_tokens": 2,
"max_tool_calls": 2,
"metadata": {},
"parallel_tool_calls": true,
"prompt_cache_key": "<string>",
"reasoning": {},
"safety_identifier": "<string>",
"store": true,
"stream": false,
"stream_options": {
"include_obfuscation": true
},
"temperature": 1,
"text": {
"format": {}
},
"tools": [
{}
],
"top_logprobs": 10,
"top_p": 0.5,
"truncation": "disabled"
}
'import requests
url = "https://api.ttapi.io/v1/responses"
payload = {
"model": "gpt-5.4-mini",
"input": "Explain quantum computing in simple terms.",
"instructions": "<string>",
"previous_response_id": "<string>",
"conversation": "<string>",
"background": False,
"include": [],
"max_output_tokens": 2,
"max_tool_calls": 2,
"metadata": {},
"parallel_tool_calls": True,
"prompt_cache_key": "<string>",
"reasoning": {},
"safety_identifier": "<string>",
"store": True,
"stream": False,
"stream_options": { "include_obfuscation": True },
"temperature": 1,
"text": { "format": {} },
"tools": [{}],
"top_logprobs": 10,
"top_p": 0.5,
"truncation": "disabled"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-5.4-mini',
input: 'Explain quantum computing in simple terms.',
instructions: '<string>',
previous_response_id: '<string>',
conversation: '<string>',
background: false,
include: [],
max_output_tokens: 2,
max_tool_calls: 2,
metadata: {},
parallel_tool_calls: true,
prompt_cache_key: '<string>',
reasoning: {},
safety_identifier: '<string>',
store: true,
stream: false,
stream_options: {include_obfuscation: true},
temperature: 1,
text: {format: {}},
tools: [{}],
top_logprobs: 10,
top_p: 0.5,
truncation: 'disabled'
})
};
fetch('https://api.ttapi.io/v1/responses', 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/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gpt-5.4-mini',
'input' => 'Explain quantum computing in simple terms.',
'instructions' => '<string>',
'previous_response_id' => '<string>',
'conversation' => '<string>',
'background' => false,
'include' => [
],
'max_output_tokens' => 2,
'max_tool_calls' => 2,
'metadata' => [
],
'parallel_tool_calls' => true,
'prompt_cache_key' => '<string>',
'reasoning' => [
],
'safety_identifier' => '<string>',
'store' => true,
'stream' => false,
'stream_options' => [
'include_obfuscation' => true
],
'temperature' => 1,
'text' => [
'format' => [
]
],
'tools' => [
[
]
],
'top_logprobs' => 10,
'top_p' => 0.5,
'truncation' => 'disabled'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ttapi.io/v1/responses"
payload := strings.NewReader("{\n \"model\": \"gpt-5.4-mini\",\n \"input\": \"Explain quantum computing in simple terms.\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"conversation\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"max_output_tokens\": 2,\n \"max_tool_calls\": 2,\n \"metadata\": {},\n \"parallel_tool_calls\": true,\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"store\": true,\n \"stream\": false,\n \"stream_options\": {\n \"include_obfuscation\": true\n },\n \"temperature\": 1,\n \"text\": {\n \"format\": {}\n },\n \"tools\": [\n {}\n ],\n \"top_logprobs\": 10,\n \"top_p\": 0.5,\n \"truncation\": \"disabled\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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/v1/responses")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-5.4-mini\",\n \"input\": \"Explain quantum computing in simple terms.\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"conversation\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"max_output_tokens\": 2,\n \"max_tool_calls\": 2,\n \"metadata\": {},\n \"parallel_tool_calls\": true,\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"store\": true,\n \"stream\": false,\n \"stream_options\": {\n \"include_obfuscation\": true\n },\n \"temperature\": 1,\n \"text\": {\n \"format\": {}\n },\n \"tools\": [\n {}\n ],\n \"top_logprobs\": 10,\n \"top_p\": 0.5,\n \"truncation\": \"disabled\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-5.4-mini\",\n \"input\": \"Explain quantum computing in simple terms.\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"conversation\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"max_output_tokens\": 2,\n \"max_tool_calls\": 2,\n \"metadata\": {},\n \"parallel_tool_calls\": true,\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"store\": true,\n \"stream\": false,\n \"stream_options\": {\n \"include_obfuscation\": true\n },\n \"temperature\": 1,\n \"text\": {\n \"format\": {}\n },\n \"tools\": [\n {}\n ],\n \"top_logprobs\": 10,\n \"top_p\": 0.5,\n \"truncation\": \"disabled\"\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b",
"object": "response",
"created_at": 1741476542,
"status": "completed",
"model": "<string>",
"output": [
{
"type": "<string>",
"id": "<string>",
"status": "<string>",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "<string>",
"refusal": "<string>",
"annotations": [
{}
],
"logprobs": [
{}
]
}
],
"call_id": "<string>",
"name": "<string>",
"arguments": "<string>"
}
],
"error": {
"code": "<string>",
"message": "<string>"
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"output_text": "<string>",
"previous_response_id": "<string>",
"store": true,
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 123
},
"total_tokens": 123
},
"metadata": {}
}{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}Responses
Creates a model response from text, image, or file input. Supports structured output, tool calls, conversation state, background processing, and streaming.
curl --request POST \
--url https://api.ttapi.io/v1/responses \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.4-mini",
"input": "Explain quantum computing in simple terms.",
"instructions": "<string>",
"previous_response_id": "<string>",
"conversation": "<string>",
"background": false,
"include": [],
"max_output_tokens": 2,
"max_tool_calls": 2,
"metadata": {},
"parallel_tool_calls": true,
"prompt_cache_key": "<string>",
"reasoning": {},
"safety_identifier": "<string>",
"store": true,
"stream": false,
"stream_options": {
"include_obfuscation": true
},
"temperature": 1,
"text": {
"format": {}
},
"tools": [
{}
],
"top_logprobs": 10,
"top_p": 0.5,
"truncation": "disabled"
}
'import requests
url = "https://api.ttapi.io/v1/responses"
payload = {
"model": "gpt-5.4-mini",
"input": "Explain quantum computing in simple terms.",
"instructions": "<string>",
"previous_response_id": "<string>",
"conversation": "<string>",
"background": False,
"include": [],
"max_output_tokens": 2,
"max_tool_calls": 2,
"metadata": {},
"parallel_tool_calls": True,
"prompt_cache_key": "<string>",
"reasoning": {},
"safety_identifier": "<string>",
"store": True,
"stream": False,
"stream_options": { "include_obfuscation": True },
"temperature": 1,
"text": { "format": {} },
"tools": [{}],
"top_logprobs": 10,
"top_p": 0.5,
"truncation": "disabled"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-5.4-mini',
input: 'Explain quantum computing in simple terms.',
instructions: '<string>',
previous_response_id: '<string>',
conversation: '<string>',
background: false,
include: [],
max_output_tokens: 2,
max_tool_calls: 2,
metadata: {},
parallel_tool_calls: true,
prompt_cache_key: '<string>',
reasoning: {},
safety_identifier: '<string>',
store: true,
stream: false,
stream_options: {include_obfuscation: true},
temperature: 1,
text: {format: {}},
tools: [{}],
top_logprobs: 10,
top_p: 0.5,
truncation: 'disabled'
})
};
fetch('https://api.ttapi.io/v1/responses', 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/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gpt-5.4-mini',
'input' => 'Explain quantum computing in simple terms.',
'instructions' => '<string>',
'previous_response_id' => '<string>',
'conversation' => '<string>',
'background' => false,
'include' => [
],
'max_output_tokens' => 2,
'max_tool_calls' => 2,
'metadata' => [
],
'parallel_tool_calls' => true,
'prompt_cache_key' => '<string>',
'reasoning' => [
],
'safety_identifier' => '<string>',
'store' => true,
'stream' => false,
'stream_options' => [
'include_obfuscation' => true
],
'temperature' => 1,
'text' => [
'format' => [
]
],
'tools' => [
[
]
],
'top_logprobs' => 10,
'top_p' => 0.5,
'truncation' => 'disabled'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ttapi.io/v1/responses"
payload := strings.NewReader("{\n \"model\": \"gpt-5.4-mini\",\n \"input\": \"Explain quantum computing in simple terms.\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"conversation\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"max_output_tokens\": 2,\n \"max_tool_calls\": 2,\n \"metadata\": {},\n \"parallel_tool_calls\": true,\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"store\": true,\n \"stream\": false,\n \"stream_options\": {\n \"include_obfuscation\": true\n },\n \"temperature\": 1,\n \"text\": {\n \"format\": {}\n },\n \"tools\": [\n {}\n ],\n \"top_logprobs\": 10,\n \"top_p\": 0.5,\n \"truncation\": \"disabled\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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/v1/responses")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-5.4-mini\",\n \"input\": \"Explain quantum computing in simple terms.\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"conversation\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"max_output_tokens\": 2,\n \"max_tool_calls\": 2,\n \"metadata\": {},\n \"parallel_tool_calls\": true,\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"store\": true,\n \"stream\": false,\n \"stream_options\": {\n \"include_obfuscation\": true\n },\n \"temperature\": 1,\n \"text\": {\n \"format\": {}\n },\n \"tools\": [\n {}\n ],\n \"top_logprobs\": 10,\n \"top_p\": 0.5,\n \"truncation\": \"disabled\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-5.4-mini\",\n \"input\": \"Explain quantum computing in simple terms.\",\n \"instructions\": \"<string>\",\n \"previous_response_id\": \"<string>\",\n \"conversation\": \"<string>\",\n \"background\": false,\n \"include\": [],\n \"max_output_tokens\": 2,\n \"max_tool_calls\": 2,\n \"metadata\": {},\n \"parallel_tool_calls\": true,\n \"prompt_cache_key\": \"<string>\",\n \"reasoning\": {},\n \"safety_identifier\": \"<string>\",\n \"store\": true,\n \"stream\": false,\n \"stream_options\": {\n \"include_obfuscation\": true\n },\n \"temperature\": 1,\n \"text\": {\n \"format\": {}\n },\n \"tools\": [\n {}\n ],\n \"top_logprobs\": 10,\n \"top_p\": 0.5,\n \"truncation\": \"disabled\"\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b",
"object": "response",
"created_at": 1741476542,
"status": "completed",
"model": "<string>",
"output": [
{
"type": "<string>",
"id": "<string>",
"status": "<string>",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "<string>",
"refusal": "<string>",
"annotations": [
{}
],
"logprobs": [
{}
]
}
],
"call_id": "<string>",
"name": "<string>",
"arguments": "<string>"
}
],
"error": {
"code": "<string>",
"message": "<string>"
},
"incomplete_details": {
"reason": "max_output_tokens"
},
"output_text": "<string>",
"previous_response_id": "<string>",
"store": true,
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"cached_tokens": 123
},
"output_tokens": 123,
"output_tokens_details": {
"reasoning_tokens": 123
},
"total_tokens": 123
},
"metadata": {}
}{
"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.
Body
Request body for the OpenAI-compatible Responses API.
Model ID used to generate the response. See Supported Models.
"gpt-5.4-mini"
Text, image, or file input to the model. A string is treated as a user message.
"Explain quantum computing in simple terms."
A system or developer message inserted into the model context. It is not carried over when previous_response_id is used.
ID of the previous response for multi-turn interactions. Cannot be used together with conversation.
Conversation that this response belongs to.
Whether to run the response in the background.
Additional output data to include in the response.
file_search_call.results, web_search_call.results, web_search_call.action.sources, message.input_image.image_url, computer_call_output.output.image_url, code_interpreter_call.outputs, reasoning.encrypted_content, message.output_text.logprobs Maximum number of generated tokens, including visible output and reasoning tokens.
x >= 1Maximum total number of built-in tool calls processed for this response.
x >= 1Up to 16 string key-value pairs attached to the response.
Show child attributes
Show child attributes
Whether the model may call tools in parallel.
Reference to a reusable prompt template.
Show child attributes
Show child attributes
Stable key used to improve prompt cache hit rates.
Prompt cache retention policy.
in-memory, 24h Reasoning configuration for supported models.
Show child attributes
Show child attributes
Stable identifier for the end user, used for abuse detection.
auto, default, flex, scale, priority Whether to store the generated response for later retrieval.
Whether to stream response events using server-sent events.
Streaming options. Set only when stream is true.
Show child attributes
Show child attributes
Sampling temperature. Change this or top_p, but generally not both.
0 <= x <= 2Show child attributes
Show child attributes
Controls which tool or tools the model may call.
none, auto, required Tools available to the model, including function and supported built-in tools.
0 <= x <= 200 <= x <= 1auto, disabled Response
Successful response. When stream is true, the endpoint returns server-sent events.
"resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b"
"response"1741476542
completed, failed, in_progress, cancelled, queued, incomplete Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
SDK convenience property containing aggregated text output.
Show child attributes
Show child attributes
Show child attributes
Show child attributes