Generate content
curl --request POST \
--url https://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Extract the invoice number, date, and total as JSON."
}
]
}
],
"generationConfig": {
"thinkingConfig": {
"thinkingLevel": "minimal"
},
"responseMimeType": "application/json",
"maxOutputTokens": 1024
}
}
'import requests
url = "https://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent"
payload = {
"contents": [
{
"role": "user",
"parts": [{ "text": "Extract the invoice number, date, and total as JSON." }]
}
],
"generationConfig": {
"thinkingConfig": { "thinkingLevel": "minimal" },
"responseMimeType": "application/json",
"maxOutputTokens": 1024
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [
{
role: 'user',
parts: [{text: 'Extract the invoice number, date, and total as JSON.'}]
}
],
generationConfig: {
thinkingConfig: {thinkingLevel: 'minimal'},
responseMimeType: 'application/json',
maxOutputTokens: 1024
}
})
};
fetch('https://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite: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://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite: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' => [
[
'role' => 'user',
'parts' => [
[
'text' => 'Extract the invoice number, date, and total as JSON.'
]
]
]
],
'generationConfig' => [
'thinkingConfig' => [
'thinkingLevel' => 'minimal'
],
'responseMimeType' => 'application/json',
'maxOutputTokens' => 1024
]
]),
CURLOPT_HTTPHEADER => [
"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://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Extract the invoice number, date, and total as JSON.\"\n }\n ]\n }\n ],\n \"generationConfig\": {\n \"thinkingConfig\": {\n \"thinkingLevel\": \"minimal\"\n },\n \"responseMimeType\": \"application/json\",\n \"maxOutputTokens\": 1024\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Extract the invoice number, date, and total as JSON.\"\n }\n ]\n }\n ],\n \"generationConfig\": {\n \"thinkingConfig\": {\n \"thinkingLevel\": \"minimal\"\n },\n \"responseMimeType\": \"application/json\",\n \"maxOutputTokens\": 1024\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Extract the invoice number, date, and total as JSON.\"\n }\n ]\n }\n ],\n \"generationConfig\": {\n \"thinkingConfig\": {\n \"thinkingLevel\": \"minimal\"\n },\n \"responseMimeType\": \"application/json\",\n \"maxOutputTokens\": 1024\n }\n}"
response = http.request(request)
puts response.read_body{
"candidates": [
{
"content": {
"parts": [
{
"text": "<string>",
"thought": true,
"thoughtSignature": "<string>",
"inlineData": {
"mimeType": "image/jpeg",
"data": "<string>"
},
"fileData": {
"mimeType": "application/pdf",
"fileUri": "<string>"
},
"functionCall": {
"name": "<string>",
"args": {}
},
"functionResponse": {
"name": "<string>",
"id": "<string>",
"response": {}
},
"executableCode": {
"language": "PYTHON",
"code": "<string>"
},
"codeExecutionResult": {
"outcome": "OUTCOME_OK",
"output": "<string>"
}
}
],
"role": "user"
},
"finishReason": "STOP",
"index": 0,
"safetyRatings": [
{}
]
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"cachedContentTokenCount": 123,
"thoughtsTokenCount": 123,
"toolUsePromptTokenCount": 123,
"totalTokenCount": 123,
"serviceTier": "standard",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 123
}
],
"toolUsePromptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 123
}
]
},
"modelVersion": "gemini-3.5-flash-lite",
"responseId": "<string>",
"quota": 123
}{
"error": {
"code": 123,
"message": "<string>",
"status": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"status": "<string>"
}
}Google
gemini-3.5-flash-lite
Generate a response with Gemini 3.5 Flash-Lite. The final non-empty conversation turn must use the user role.
POST
/
v1beta
/
models
/
gemini-3.5-flash-lite:generateContent
Generate content
curl --request POST \
--url https://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent \
--header 'Content-Type: application/json' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Extract the invoice number, date, and total as JSON."
}
]
}
],
"generationConfig": {
"thinkingConfig": {
"thinkingLevel": "minimal"
},
"responseMimeType": "application/json",
"maxOutputTokens": 1024
}
}
'import requests
url = "https://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent"
payload = {
"contents": [
{
"role": "user",
"parts": [{ "text": "Extract the invoice number, date, and total as JSON." }]
}
],
"generationConfig": {
"thinkingConfig": { "thinkingLevel": "minimal" },
"responseMimeType": "application/json",
"maxOutputTokens": 1024
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [
{
role: 'user',
parts: [{text: 'Extract the invoice number, date, and total as JSON.'}]
}
],
generationConfig: {
thinkingConfig: {thinkingLevel: 'minimal'},
responseMimeType: 'application/json',
maxOutputTokens: 1024
}
})
};
fetch('https://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite: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://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite: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' => [
[
'role' => 'user',
'parts' => [
[
'text' => 'Extract the invoice number, date, and total as JSON.'
]
]
]
],
'generationConfig' => [
'thinkingConfig' => [
'thinkingLevel' => 'minimal'
],
'responseMimeType' => 'application/json',
'maxOutputTokens' => 1024
]
]),
CURLOPT_HTTPHEADER => [
"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://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Extract the invoice number, date, and total as JSON.\"\n }\n ]\n }\n ],\n \"generationConfig\": {\n \"thinkingConfig\": {\n \"thinkingLevel\": \"minimal\"\n },\n \"responseMimeType\": \"application/json\",\n \"maxOutputTokens\": 1024\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Extract the invoice number, date, and total as JSON.\"\n }\n ]\n }\n ],\n \"generationConfig\": {\n \"thinkingConfig\": {\n \"thinkingLevel\": \"minimal\"\n },\n \"responseMimeType\": \"application/json\",\n \"maxOutputTokens\": 1024\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Extract the invoice number, date, and total as JSON.\"\n }\n ]\n }\n ],\n \"generationConfig\": {\n \"thinkingConfig\": {\n \"thinkingLevel\": \"minimal\"\n },\n \"responseMimeType\": \"application/json\",\n \"maxOutputTokens\": 1024\n }\n}"
response = http.request(request)
puts response.read_body{
"candidates": [
{
"content": {
"parts": [
{
"text": "<string>",
"thought": true,
"thoughtSignature": "<string>",
"inlineData": {
"mimeType": "image/jpeg",
"data": "<string>"
},
"fileData": {
"mimeType": "application/pdf",
"fileUri": "<string>"
},
"functionCall": {
"name": "<string>",
"args": {}
},
"functionResponse": {
"name": "<string>",
"id": "<string>",
"response": {}
},
"executableCode": {
"language": "PYTHON",
"code": "<string>"
},
"codeExecutionResult": {
"outcome": "OUTCOME_OK",
"output": "<string>"
}
}
],
"role": "user"
},
"finishReason": "STOP",
"index": 0,
"safetyRatings": [
{}
]
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"cachedContentTokenCount": 123,
"thoughtsTokenCount": 123,
"toolUsePromptTokenCount": 123,
"totalTokenCount": 123,
"serviceTier": "standard",
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 123
}
],
"toolUsePromptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 123
}
]
},
"modelVersion": "gemini-3.5-flash-lite",
"responseId": "<string>",
"quota": 123
}{
"error": {
"code": 123,
"message": "<string>",
"status": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"status": "<string>"
}
}Query Parameters
AnyFast API key.
Body
application/json
Conversation turns. Do not end the request with a non-empty model turn.
Minimum array length:
1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Do not include temperature, topP, topK, candidateCount, or thinkingBudget.
Show child attributes
Show child attributes
Function declarations or supported built-in Gemini tools such as Google Search and code execution.
Show child attributes
Show child attributes
Tool execution and function-calling configuration.
Per-category content safety thresholds.
Show child attributes
Show child attributes
Was this page helpful?
⌘I