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 リファレンスとインタラクティブな Playground: 公式のリクエスト形式、デフォルトで推論なし、Search grounding やその他のツールに対応しています。
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 Key は不要)を x-goog-api-key に入れて送信してください — デフォルトでは推論なしなので、応答は高速です。デフォルトでは推論出力はありません。 深い推論には
thinkingConfig: {"thinkingLevel": "high"} を渡してください(私たちのテストでは、推論を確実に有効にするのは上位ティアのみです)。検索グラウンディング、コード実行、URL コンテキスト、Maps ツールは、このネイティブ エンドポイントでのみ動作します。機能と課金: Gemini 3.5 Flash-Lite の概要。- ストリーミングの場合、URL を
:streamGenerateContent?alt=sseに変更してください(プレイグラウンドでは非ストリーミングを示しています) - コード実行は機能しますが、
executableCode/codeExecutionResultフィールドは現在エコーされず — 結果はテキスト本文に表示されます :countTokensと明示的なキャッシュ API はまだ有効化されていません; Computer Use はこのモデルでは公式にはサポートされていません
パラメータのクイックリファレンス
| パラメータ | 型 | 必須 | 備考 |
|---|---|---|---|
contents | array | ✓ | 会話内容; parts は text と inlineData(base64 image/PDF/audio/video)を混在できます |
systemInstruction | object | システム指示 | |
generationConfig.thinkingConfig.thinkingLevel | string | デフォルトでは推論なし; high は約1000 thinking tokensで測定 | |
generationConfig.thinkingConfig.includeThoughts | bool | 推論部分をエコーします(高ティアと組み合わせます) | |
generationConfig.responseMimeType + responseSchema | 構造化出力(JSON Schema) | ||
tools | array | google_search / url_context / codeExecution / google_maps / functionDeclarations |
レスポンスに関する注意
- thinking の消費量は
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