curl --request POST \
--url https://api.ttapi.io/v1beta/models/{model}:generateContent \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"contents": [
{
"parts": [
{
"text": "<string>",
"functionCall": {
"name": "<string>",
"args": {}
},
"functionResponse": {
"name": "<string>",
"response": {}
},
"executableCode": {},
"codeExecutionResult": {},
"thought": true,
"thoughtSignature": "<string>"
}
]
}
],
"tools": [
{}
],
"toolConfig": {},
"safetySettings": [
{}
],
"generationConfig": {
"stopSequences": [
"<string>"
],
"responseSchema": {},
"responseJsonSchema": {},
"responseModalities": [],
"candidateCount": 1,
"maxOutputTokens": 2,
"temperature": 1,
"topP": 0.5,
"topK": 2,
"seed": 123,
"presencePenalty": 123,
"frequencyPenalty": 123,
"responseLogprobs": true,
"logprobs": 10,
"enableEnhancedCivicAnswers": true,
"thinkingConfig": {
"includeThoughts": true,
"thinkingBudget": 123
},
"imageConfig": {
"aspectRatio": "<string>"
},
"responseFormat": {}
},
"cachedContent": "cachedContents/abc123",
"store": true
}
'import requests
url = "https://api.ttapi.io/v1beta/models/{model}:generateContent"
payload = {
"contents": [{ "parts": [
{
"text": "<string>",
"functionCall": {
"name": "<string>",
"args": {}
},
"functionResponse": {
"name": "<string>",
"response": {}
},
"executableCode": {},
"codeExecutionResult": {},
"thought": True,
"thoughtSignature": "<string>"
}
] }],
"tools": [{}],
"toolConfig": {},
"safetySettings": [{}],
"generationConfig": {
"stopSequences": ["<string>"],
"responseSchema": {},
"responseJsonSchema": {},
"responseModalities": [],
"candidateCount": 1,
"maxOutputTokens": 2,
"temperature": 1,
"topP": 0.5,
"topK": 2,
"seed": 123,
"presencePenalty": 123,
"frequencyPenalty": 123,
"responseLogprobs": True,
"logprobs": 10,
"enableEnhancedCivicAnswers": True,
"thinkingConfig": {
"includeThoughts": True,
"thinkingBudget": 123
},
"imageConfig": { "aspectRatio": "<string>" },
"responseFormat": {}
},
"cachedContent": "cachedContents/abc123",
"store": True
}
headers = {
"TT-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'TT-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [
{
parts: [
{
text: '<string>',
functionCall: {name: '<string>', args: {}},
functionResponse: {name: '<string>', response: {}},
executableCode: {},
codeExecutionResult: {},
thought: true,
thoughtSignature: '<string>'
}
]
}
],
tools: [{}],
toolConfig: {},
safetySettings: [{}],
generationConfig: {
stopSequences: ['<string>'],
responseSchema: {},
responseJsonSchema: {},
responseModalities: [],
candidateCount: 1,
maxOutputTokens: 2,
temperature: 1,
topP: 0.5,
topK: 2,
seed: 123,
presencePenalty: 123,
frequencyPenalty: 123,
responseLogprobs: true,
logprobs: 10,
enableEnhancedCivicAnswers: true,
thinkingConfig: {includeThoughts: true, thinkingBudget: 123},
imageConfig: {aspectRatio: '<string>'},
responseFormat: {}
},
cachedContent: 'cachedContents/abc123',
store: true
})
};
fetch('https://api.ttapi.io/v1beta/models/{model}:generateContent', 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/v1beta/models/{model}:generateContent",
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([
'contents' => [
[
'parts' => [
[
'text' => '<string>',
'functionCall' => [
'name' => '<string>',
'args' => [
]
],
'functionResponse' => [
'name' => '<string>',
'response' => [
]
],
'executableCode' => [
],
'codeExecutionResult' => [
],
'thought' => true,
'thoughtSignature' => '<string>'
]
]
]
],
'tools' => [
[
]
],
'toolConfig' => [
],
'safetySettings' => [
[
]
],
'generationConfig' => [
'stopSequences' => [
'<string>'
],
'responseSchema' => [
],
'responseJsonSchema' => [
],
'responseModalities' => [
],
'candidateCount' => 1,
'maxOutputTokens' => 2,
'temperature' => 1,
'topP' => 0.5,
'topK' => 2,
'seed' => 123,
'presencePenalty' => 123,
'frequencyPenalty' => 123,
'responseLogprobs' => true,
'logprobs' => 10,
'enableEnhancedCivicAnswers' => true,
'thinkingConfig' => [
'includeThoughts' => true,
'thinkingBudget' => 123
],
'imageConfig' => [
'aspectRatio' => '<string>'
],
'responseFormat' => [
]
],
'cachedContent' => 'cachedContents/abc123',
'store' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ttapi.io/v1beta/models/{model}:generateContent"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"functionCall\": {\n \"name\": \"<string>\",\n \"args\": {}\n },\n \"functionResponse\": {\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"executableCode\": {},\n \"codeExecutionResult\": {},\n \"thought\": true,\n \"thoughtSignature\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {}\n ],\n \"toolConfig\": {},\n \"safetySettings\": [\n {}\n ],\n \"generationConfig\": {\n \"stopSequences\": [\n \"<string>\"\n ],\n \"responseSchema\": {},\n \"responseJsonSchema\": {},\n \"responseModalities\": [],\n \"candidateCount\": 1,\n \"maxOutputTokens\": 2,\n \"temperature\": 1,\n \"topP\": 0.5,\n \"topK\": 2,\n \"seed\": 123,\n \"presencePenalty\": 123,\n \"frequencyPenalty\": 123,\n \"responseLogprobs\": true,\n \"logprobs\": 10,\n \"enableEnhancedCivicAnswers\": true,\n \"thinkingConfig\": {\n \"includeThoughts\": true,\n \"thinkingBudget\": 123\n },\n \"imageConfig\": {\n \"aspectRatio\": \"<string>\"\n },\n \"responseFormat\": {}\n },\n \"cachedContent\": \"cachedContents/abc123\",\n \"store\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TT-API-KEY", "<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/v1beta/models/{model}:generateContent")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"functionCall\": {\n \"name\": \"<string>\",\n \"args\": {}\n },\n \"functionResponse\": {\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"executableCode\": {},\n \"codeExecutionResult\": {},\n \"thought\": true,\n \"thoughtSignature\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {}\n ],\n \"toolConfig\": {},\n \"safetySettings\": [\n {}\n ],\n \"generationConfig\": {\n \"stopSequences\": [\n \"<string>\"\n ],\n \"responseSchema\": {},\n \"responseJsonSchema\": {},\n \"responseModalities\": [],\n \"candidateCount\": 1,\n \"maxOutputTokens\": 2,\n \"temperature\": 1,\n \"topP\": 0.5,\n \"topK\": 2,\n \"seed\": 123,\n \"presencePenalty\": 123,\n \"frequencyPenalty\": 123,\n \"responseLogprobs\": true,\n \"logprobs\": 10,\n \"enableEnhancedCivicAnswers\": true,\n \"thinkingConfig\": {\n \"includeThoughts\": true,\n \"thinkingBudget\": 123\n },\n \"imageConfig\": {\n \"aspectRatio\": \"<string>\"\n },\n \"responseFormat\": {}\n },\n \"cachedContent\": \"cachedContents/abc123\",\n \"store\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/v1beta/models/{model}:generateContent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TT-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"functionCall\": {\n \"name\": \"<string>\",\n \"args\": {}\n },\n \"functionResponse\": {\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"executableCode\": {},\n \"codeExecutionResult\": {},\n \"thought\": true,\n \"thoughtSignature\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {}\n ],\n \"toolConfig\": {},\n \"safetySettings\": [\n {}\n ],\n \"generationConfig\": {\n \"stopSequences\": [\n \"<string>\"\n ],\n \"responseSchema\": {},\n \"responseJsonSchema\": {},\n \"responseModalities\": [],\n \"candidateCount\": 1,\n \"maxOutputTokens\": 2,\n \"temperature\": 1,\n \"topP\": 0.5,\n \"topK\": 2,\n \"seed\": 123,\n \"presencePenalty\": 123,\n \"frequencyPenalty\": 123,\n \"responseLogprobs\": true,\n \"logprobs\": 10,\n \"enableEnhancedCivicAnswers\": true,\n \"thinkingConfig\": {\n \"includeThoughts\": true,\n \"thinkingBudget\": 123\n },\n \"imageConfig\": {\n \"aspectRatio\": \"<string>\"\n },\n \"responseFormat\": {}\n },\n \"cachedContent\": \"cachedContents/abc123\",\n \"store\": true\n}"
response = http.request(request)
puts response.read_body{
"candidates": [
{
"content": {
"parts": [
{
"text": "<string>",
"inlineData": {
"mimeType": "image/jpeg",
"data": "<string>"
},
"fileData": {
"fileUri": "<string>",
"mimeType": "<string>"
},
"functionCall": {
"name": "<string>",
"args": {}
},
"functionResponse": {
"name": "<string>",
"response": {}
},
"executableCode": {},
"codeExecutionResult": {},
"thought": true,
"thoughtSignature": "<string>"
}
]
},
"finishMessage": "<string>",
"safetyRatings": [
{}
],
"citationMetadata": {},
"groundingMetadata": {},
"avgLogprobs": 123,
"index": 123
}
],
"promptFeedback": {
"blockReason": "<string>",
"safetyRatings": [
{}
]
},
"usageMetadata": {
"promptTokenCount": 123,
"cachedContentTokenCount": 123,
"candidatesTokenCount": 123,
"toolUsePromptTokenCount": 123,
"thoughtsTokenCount": 123,
"totalTokenCount": 123,
"serviceTier": "<string>"
},
"modelVersion": "<string>",
"responseId": "<string>",
"modelStatus": {}
}{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}Gemini Generate Content
Generates a Gemini response using the native generateContent REST request and response format.
curl --request POST \
--url https://api.ttapi.io/v1beta/models/{model}:generateContent \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"contents": [
{
"parts": [
{
"text": "<string>",
"functionCall": {
"name": "<string>",
"args": {}
},
"functionResponse": {
"name": "<string>",
"response": {}
},
"executableCode": {},
"codeExecutionResult": {},
"thought": true,
"thoughtSignature": "<string>"
}
]
}
],
"tools": [
{}
],
"toolConfig": {},
"safetySettings": [
{}
],
"generationConfig": {
"stopSequences": [
"<string>"
],
"responseSchema": {},
"responseJsonSchema": {},
"responseModalities": [],
"candidateCount": 1,
"maxOutputTokens": 2,
"temperature": 1,
"topP": 0.5,
"topK": 2,
"seed": 123,
"presencePenalty": 123,
"frequencyPenalty": 123,
"responseLogprobs": true,
"logprobs": 10,
"enableEnhancedCivicAnswers": true,
"thinkingConfig": {
"includeThoughts": true,
"thinkingBudget": 123
},
"imageConfig": {
"aspectRatio": "<string>"
},
"responseFormat": {}
},
"cachedContent": "cachedContents/abc123",
"store": true
}
'import requests
url = "https://api.ttapi.io/v1beta/models/{model}:generateContent"
payload = {
"contents": [{ "parts": [
{
"text": "<string>",
"functionCall": {
"name": "<string>",
"args": {}
},
"functionResponse": {
"name": "<string>",
"response": {}
},
"executableCode": {},
"codeExecutionResult": {},
"thought": True,
"thoughtSignature": "<string>"
}
] }],
"tools": [{}],
"toolConfig": {},
"safetySettings": [{}],
"generationConfig": {
"stopSequences": ["<string>"],
"responseSchema": {},
"responseJsonSchema": {},
"responseModalities": [],
"candidateCount": 1,
"maxOutputTokens": 2,
"temperature": 1,
"topP": 0.5,
"topK": 2,
"seed": 123,
"presencePenalty": 123,
"frequencyPenalty": 123,
"responseLogprobs": True,
"logprobs": 10,
"enableEnhancedCivicAnswers": True,
"thinkingConfig": {
"includeThoughts": True,
"thinkingBudget": 123
},
"imageConfig": { "aspectRatio": "<string>" },
"responseFormat": {}
},
"cachedContent": "cachedContents/abc123",
"store": True
}
headers = {
"TT-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'TT-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [
{
parts: [
{
text: '<string>',
functionCall: {name: '<string>', args: {}},
functionResponse: {name: '<string>', response: {}},
executableCode: {},
codeExecutionResult: {},
thought: true,
thoughtSignature: '<string>'
}
]
}
],
tools: [{}],
toolConfig: {},
safetySettings: [{}],
generationConfig: {
stopSequences: ['<string>'],
responseSchema: {},
responseJsonSchema: {},
responseModalities: [],
candidateCount: 1,
maxOutputTokens: 2,
temperature: 1,
topP: 0.5,
topK: 2,
seed: 123,
presencePenalty: 123,
frequencyPenalty: 123,
responseLogprobs: true,
logprobs: 10,
enableEnhancedCivicAnswers: true,
thinkingConfig: {includeThoughts: true, thinkingBudget: 123},
imageConfig: {aspectRatio: '<string>'},
responseFormat: {}
},
cachedContent: 'cachedContents/abc123',
store: true
})
};
fetch('https://api.ttapi.io/v1beta/models/{model}:generateContent', 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/v1beta/models/{model}:generateContent",
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([
'contents' => [
[
'parts' => [
[
'text' => '<string>',
'functionCall' => [
'name' => '<string>',
'args' => [
]
],
'functionResponse' => [
'name' => '<string>',
'response' => [
]
],
'executableCode' => [
],
'codeExecutionResult' => [
],
'thought' => true,
'thoughtSignature' => '<string>'
]
]
]
],
'tools' => [
[
]
],
'toolConfig' => [
],
'safetySettings' => [
[
]
],
'generationConfig' => [
'stopSequences' => [
'<string>'
],
'responseSchema' => [
],
'responseJsonSchema' => [
],
'responseModalities' => [
],
'candidateCount' => 1,
'maxOutputTokens' => 2,
'temperature' => 1,
'topP' => 0.5,
'topK' => 2,
'seed' => 123,
'presencePenalty' => 123,
'frequencyPenalty' => 123,
'responseLogprobs' => true,
'logprobs' => 10,
'enableEnhancedCivicAnswers' => true,
'thinkingConfig' => [
'includeThoughts' => true,
'thinkingBudget' => 123
],
'imageConfig' => [
'aspectRatio' => '<string>'
],
'responseFormat' => [
]
],
'cachedContent' => 'cachedContents/abc123',
'store' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ttapi.io/v1beta/models/{model}:generateContent"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"functionCall\": {\n \"name\": \"<string>\",\n \"args\": {}\n },\n \"functionResponse\": {\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"executableCode\": {},\n \"codeExecutionResult\": {},\n \"thought\": true,\n \"thoughtSignature\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {}\n ],\n \"toolConfig\": {},\n \"safetySettings\": [\n {}\n ],\n \"generationConfig\": {\n \"stopSequences\": [\n \"<string>\"\n ],\n \"responseSchema\": {},\n \"responseJsonSchema\": {},\n \"responseModalities\": [],\n \"candidateCount\": 1,\n \"maxOutputTokens\": 2,\n \"temperature\": 1,\n \"topP\": 0.5,\n \"topK\": 2,\n \"seed\": 123,\n \"presencePenalty\": 123,\n \"frequencyPenalty\": 123,\n \"responseLogprobs\": true,\n \"logprobs\": 10,\n \"enableEnhancedCivicAnswers\": true,\n \"thinkingConfig\": {\n \"includeThoughts\": true,\n \"thinkingBudget\": 123\n },\n \"imageConfig\": {\n \"aspectRatio\": \"<string>\"\n },\n \"responseFormat\": {}\n },\n \"cachedContent\": \"cachedContents/abc123\",\n \"store\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TT-API-KEY", "<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/v1beta/models/{model}:generateContent")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"functionCall\": {\n \"name\": \"<string>\",\n \"args\": {}\n },\n \"functionResponse\": {\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"executableCode\": {},\n \"codeExecutionResult\": {},\n \"thought\": true,\n \"thoughtSignature\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {}\n ],\n \"toolConfig\": {},\n \"safetySettings\": [\n {}\n ],\n \"generationConfig\": {\n \"stopSequences\": [\n \"<string>\"\n ],\n \"responseSchema\": {},\n \"responseJsonSchema\": {},\n \"responseModalities\": [],\n \"candidateCount\": 1,\n \"maxOutputTokens\": 2,\n \"temperature\": 1,\n \"topP\": 0.5,\n \"topK\": 2,\n \"seed\": 123,\n \"presencePenalty\": 123,\n \"frequencyPenalty\": 123,\n \"responseLogprobs\": true,\n \"logprobs\": 10,\n \"enableEnhancedCivicAnswers\": true,\n \"thinkingConfig\": {\n \"includeThoughts\": true,\n \"thinkingBudget\": 123\n },\n \"imageConfig\": {\n \"aspectRatio\": \"<string>\"\n },\n \"responseFormat\": {}\n },\n \"cachedContent\": \"cachedContents/abc123\",\n \"store\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/v1beta/models/{model}:generateContent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TT-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"parts\": [\n {\n \"text\": \"<string>\",\n \"functionCall\": {\n \"name\": \"<string>\",\n \"args\": {}\n },\n \"functionResponse\": {\n \"name\": \"<string>\",\n \"response\": {}\n },\n \"executableCode\": {},\n \"codeExecutionResult\": {},\n \"thought\": true,\n \"thoughtSignature\": \"<string>\"\n }\n ]\n }\n ],\n \"tools\": [\n {}\n ],\n \"toolConfig\": {},\n \"safetySettings\": [\n {}\n ],\n \"generationConfig\": {\n \"stopSequences\": [\n \"<string>\"\n ],\n \"responseSchema\": {},\n \"responseJsonSchema\": {},\n \"responseModalities\": [],\n \"candidateCount\": 1,\n \"maxOutputTokens\": 2,\n \"temperature\": 1,\n \"topP\": 0.5,\n \"topK\": 2,\n \"seed\": 123,\n \"presencePenalty\": 123,\n \"frequencyPenalty\": 123,\n \"responseLogprobs\": true,\n \"logprobs\": 10,\n \"enableEnhancedCivicAnswers\": true,\n \"thinkingConfig\": {\n \"includeThoughts\": true,\n \"thinkingBudget\": 123\n },\n \"imageConfig\": {\n \"aspectRatio\": \"<string>\"\n },\n \"responseFormat\": {}\n },\n \"cachedContent\": \"cachedContents/abc123\",\n \"store\": true\n}"
response = http.request(request)
puts response.read_body{
"candidates": [
{
"content": {
"parts": [
{
"text": "<string>",
"inlineData": {
"mimeType": "image/jpeg",
"data": "<string>"
},
"fileData": {
"fileUri": "<string>",
"mimeType": "<string>"
},
"functionCall": {
"name": "<string>",
"args": {}
},
"functionResponse": {
"name": "<string>",
"response": {}
},
"executableCode": {},
"codeExecutionResult": {},
"thought": true,
"thoughtSignature": "<string>"
}
]
},
"finishMessage": "<string>",
"safetyRatings": [
{}
],
"citationMetadata": {},
"groundingMetadata": {},
"avgLogprobs": 123,
"index": 123
}
],
"promptFeedback": {
"blockReason": "<string>",
"safetyRatings": [
{}
]
},
"usageMetadata": {
"promptTokenCount": 123,
"cachedContentTokenCount": 123,
"candidatesTokenCount": 123,
"toolUsePromptTokenCount": 123,
"thoughtsTokenCount": 123,
"totalTokenCount": 123,
"serviceTier": "<string>"
},
"modelVersion": "<string>",
"responseId": "<string>",
"modelStatus": {}
}{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}contents for text or multimodal conversation turns. The endpoint also
supports system instructions, tools, safety settings, cached content, structured
output, thinking configuration, and model-specific generation options.Authorizations
You can obtain your API key from the TTAPI Dashboard.
Path Parameters
Gemini model ID.
"gemini-3.5-flash"
Body
Request body for the Gemini generateContent REST format.
Current conversation content. Include the full history for multi-turn requests.
1Show child attributes
Show child attributes
Tools the model may use, such as function declarations, code execution, or supported built-in tools.
Configuration shared by the tools in this request.
Per-category safety blocking settings.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Generation and output configuration. Availability varies by model.
Show child attributes
Show child attributes
Cached content resource to use as context. Format: cachedContents/{cachedContent}.
"cachedContents/abc123"
Service tier for this request.
unspecified, standard, flex, priority Overrides the project-level request logging configuration.