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": "Объясни квантовые вычисления простыми словами.",
"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": "Объясни квантовые вычисления простыми словами.",
"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: 'Объясни квантовые вычисления простыми словами.',
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' => 'Объясни квантовые вычисления простыми словами.',
'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\": \"Объясни квантовые вычисления простыми словами.\",\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\": \"Объясни квантовые вычисления простыми словами.\",\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\": \"Объясни квантовые вычисления простыми словами.\",\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."
}Ответы OpenAI
Создаёт ответ модели из текста, изображения или файла. Поддерживает структурированный вывод, вызовы инструментов, состояние диалога, фоновую обработку и потоковую передачу.
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": "Объясни квантовые вычисления простыми словами.",
"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": "Объясни квантовые вычисления простыми словами.",
"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: 'Объясни квантовые вычисления простыми словами.',
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' => 'Объясни квантовые вычисления простыми словами.',
'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\": \"Объясни квантовые вычисления простыми словами.\",\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\": \"Объясни квантовые вычисления простыми словами.\",\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\": \"Объясни квантовые вычисления простыми словами.\",\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."
}Авторизации
Вы можете получить API-ключ в панель управления TTAPI.
Тело
Тело запроса для OpenAI-совместимого Responses API.
Идентификатор модели для генерации ответа. См. Поддерживаемые модели.
"gpt-5.4-mini"
Текст, изображение или файл для модели. Строка интерпретируется как сообщение пользователя.
"Объясни квантовые вычисления простыми словами."
Инструкция system или developer, добавляемая в контекст модели. При использовании previous_response_id инструкция прошлого ответа не наследуется.
Идентификатор предыдущего ответа для многошагового диалога. Нельзя использовать вместе с conversation.
Диалог, к которому относится этот ответ.
Запускать ли генерацию ответа в фоновом режиме.
Дополнительные данные, которые нужно включить в ответ.
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 Максимальное число сгенерированных токенов, включая видимый вывод и токены рассуждений.
x >= 1Максимальное общее число вызовов встроенных инструментов в этом ответе.
x >= 1До 16 строковых пар ключ-значение, прикреплённых к ответу.
Show child attributes
Show child attributes
Разрешены ли параллельные вызовы инструментов.
Ссылка на многократно используемый шаблон промпта.
Show child attributes
Show child attributes
Стабильный ключ для повышения вероятности попадания в кэш промпта.
Политика хранения кэша промпта.
in-memory, 24h Параметры рассуждений для поддерживаемых моделей.
Show child attributes
Show child attributes
Стабильный идентификатор конечного пользователя для обнаружения злоупотреблений.
auto, default, flex, scale, priority Сохранять ли сгенерированный ответ для последующего получения через API.
Передавать ли события ответа потоково через Server-Sent Events.
Параметры потоковой передачи. Указывайте только при stream=true.
Show child attributes
Show child attributes
Температура сэмплирования. Обычно изменяют temperature или top_p, но не оба параметра одновременно.
0 <= x <= 2Show child attributes
Show child attributes
Управляет выбором инструментов моделью.
none, auto, required Функции и поддерживаемые встроенные инструменты, доступные модели.
0 <= x <= 200 <= x <= 1auto, disabled Ответ
Успешный ответ. При stream=true возвращается поток 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 с объединённым текстовым выводом.
Show child attributes
Show child attributes
Show child attributes
Show child attributes