Text generation: Gemini 3.5 Flash-Lite (native Gemini format)
curl --request POST \
--url https://api.apiyi.com/v1beta/models/gemini-3.5-flash-lite:generateContent \
--header 'Content-Type: application/json' \
--header 'x-goog-api-key: <api-key>' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Introduce yourself in one sentence"
}
]
}
]
}
'import requests
url = "https://api.apiyi.com/v1beta/models/gemini-3.5-flash-lite:generateContent"
payload = { "contents": [
{
"role": "user",
"parts": [{ "text": "Introduce yourself in one sentence" }]
}
] }
headers = {
"x-goog-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-goog-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [{role: 'user', parts: [{text: 'Introduce yourself in one sentence'}]}]
})
};
fetch('https://api.apiyi.com/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://api.apiyi.com/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' => 'Introduce yourself in one sentence'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-goog-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.apiyi.com/v1beta/models/gemini-3.5-flash-lite:generateContent"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Introduce yourself in one sentence\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-goog-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.apiyi.com/v1beta/models/gemini-3.5-flash-lite:generateContent")
.header("x-goog-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Introduce yourself in one sentence\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/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["x-goog-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Introduce yourself in one sentence\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"candidates": [
{
"content": {
"role": "<string>",
"parts": [
{}
]
},
"finishReason": "<string>",
"groundingMetadata": {}
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"thoughtsTokenCount": 123,
"totalTokenCount": 123
},
"modelVersion": "<string>"
}Gemini 3.5 Flash-Lite
Gemini 3.5 Flash-Lite 네이티브 API 레퍼런스
Gemini 3.5 Flash-Lite 네이티브 generateContent API 레퍼런스와 대화형 플레이그라운드: 공식 요청 형식, 기본값은 추론 없음, Search grounding 및 기타 tools를 지원합니다.
POST
/
v1beta
/
models
/
gemini-3.5-flash-lite:generateContent
Text generation: Gemini 3.5 Flash-Lite (native Gemini format)
curl --request POST \
--url https://api.apiyi.com/v1beta/models/gemini-3.5-flash-lite:generateContent \
--header 'Content-Type: application/json' \
--header 'x-goog-api-key: <api-key>' \
--data '
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Introduce yourself in one sentence"
}
]
}
]
}
'import requests
url = "https://api.apiyi.com/v1beta/models/gemini-3.5-flash-lite:generateContent"
payload = { "contents": [
{
"role": "user",
"parts": [{ "text": "Introduce yourself in one sentence" }]
}
] }
headers = {
"x-goog-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-goog-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contents: [{role: 'user', parts: [{text: 'Introduce yourself in one sentence'}]}]
})
};
fetch('https://api.apiyi.com/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://api.apiyi.com/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' => 'Introduce yourself in one sentence'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-goog-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.apiyi.com/v1beta/models/gemini-3.5-flash-lite:generateContent"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Introduce yourself in one sentence\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-goog-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.apiyi.com/v1beta/models/gemini-3.5-flash-lite:generateContent")
.header("x-goog-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Introduce yourself in one sentence\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/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["x-goog-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Introduce yourself in one sentence\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"candidates": [
{
"content": {
"role": "<string>",
"parts": [
{}
]
},
"finishReason": "<string>",
"groundingMetadata": {}
}
],
"usageMetadata": {
"promptTokenCount": 123,
"candidatesTokenCount": 123,
"thoughtsTokenCount": 123,
"totalTokenCount": 123
},
"modelVersion": "<string>"
}오른쪽의 플레이그라운드를 사용하십시오:
sk-your-api-key(귀하의 APIYI token — Google 키가 필요 없습니다)을 x-goog-api-key에 넣고 보내기를 누르십시오 — 기본적으로 추론이 없어서 응답이 빠릅니다.기본적으로 추론은 출력되지 않습니다. 심층 추론에는
thinkingConfig: {"thinkingLevel": "high"}를 전달하십시오(저희 테스트에서는 상위 티어만 안정적으로 추론을 트리거합니다). 검색 그라운딩, 코드 실행, URL 컨텍스트, 그리고 Maps tools는 이 네이티브 엔드포인트에서만 작동합니다. 기능과 가격: Gemini 3.5 Flash-Lite 개요.- 스트리밍의 경우 URL을
:streamGenerateContent?alt=sse로 변경하십시오(플레이그라운드는 비스트리밍을 보여줍니다) - 코드 실행은 작동하지만
executableCode/codeExecutionResult필드는 현재 반영되지 않습니다 — 결과는 텍스트 본문에 나타납니다 :countTokens와 명시적 캐시 API는 아직 활성화되지 않았으며; Computer Use는 이 모델에서 공식적으로 지원되지 않습니다
매개변수 빠른 참조
| 매개변수 | 유형 | 필수 | 비고 |
|---|---|---|---|
contents | array | ✓ | 대화 내용; parts은 text와 inlineData(base64 이미지/PDF/오디오/동영상)를 혼합할 수 있습니다 |
systemInstruction | object | 시스템 지시문 | |
generationConfig.thinkingConfig.thinkingLevel | string | 기본적으로 추론 없음; high은 약 1000개의 추론 token 기준으로 측정됩니다 | |
generationConfig.thinkingConfig.includeThoughts | bool | 추론 부분을 에코합니다(고급 등급과 함께 사용) | |
generationConfig.responseMimeType + responseSchema | 구조화된 출력(JSON Schema) | ||
tools | array | google_search / url_context / codeExecution / google_maps / functionDeclarations |
응답 참고사항
- 추론 비용은
usageMetadata.thoughtsTokenCount입니다(기본값은 0입니다) - 근거 소스는
candidates[0].groundingMetadata에 표시되며, URL 컨텍스트는urlContextMetadata에 있습니다 - 테스트에서 이 모델에서는 암묵적 캐시 적중이 관찰되지 않았습니다. 이를 바탕으로 비용 모델을 만들지 마십시오
인증
APIYI token, the sk- prefixed key
본문
application/json
Conversation contents; parts can mix modalities
Show child attributes
Show child attributes
System instruction
Show child attributes
Show child attributes
Generation config
Show child attributes
Show child attributes
Tools: google_search / url_context / codeExecution / functionDeclarations, etc.
이 페이지가 도움이 되었나요?
⌘I