Text generation: Gemini 3.6 Flash (native Gemini format)
curl --request POST \
--url https://api.apiyi.com/v1beta/models/gemini-3.6-flash: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.6-flash: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.6-flash: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.6-flash: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.6-flash: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.6-flash: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.6-flash: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.6 Flash
Gemini 3.6 Flash 네이티브 API 레퍼런스
Gemini 3.6 Flash 네이티브 generateContent API 레퍼런스와 대화형 플레이그라운드: Search 그라운딩, 코드 실행, URL 컨텍스트 도구를 포함한 공식 요청 형식.
POST
/
v1beta
/
models
/
gemini-3.6-flash:generateContent
Text generation: Gemini 3.6 Flash (native Gemini format)
curl --request POST \
--url https://api.apiyi.com/v1beta/models/gemini-3.6-flash: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.6-flash: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.6-flash: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.6-flash: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.6-flash: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.6-flash: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.6-flash: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에 넣으십시오. 기본 예제는 추론을 low로 설정합니다. 보내기를 눌러 응답을 확인하십시오.추론은 기본적으로 켜져 있습니다. 비용에 민감한 호출의 경우
thinkingConfig: {"thinkingLevel": "minimal"} 또는 {"thinkingBudget": 0}를 전달하십시오. 검색 그라운딩, 코드 실행, URL 컨텍스트, 그리고 Maps 도구는 이 네이티브 엔드포인트에서만 동작합니다. 기능, 요금, 그리고 측정된 추론 단계: Gemini 3.6 Flash 개요.- 스트리밍하려면 URL을
:streamGenerateContent?alt=sse로 변경하십시오(플레이그라운드는 스트리밍이 아님을 보여줍니다) - 코드 실행은 동작하지만,
executableCode/codeExecutionResult필드는 현재 에코되지 않습니다 — 결과는 텍스트 본문에 표시됩니다 :countTokens과 명시적 캐시 API(cachedContents)는 아직 플랫폼에서 활성화되어 있지 않습니다
매개변수 빠른 참조
| 매개변수 | 유형 | 필수 | 비고 |
|---|---|---|---|
contents | array | ✓ | 대화 내용; parts는 text와 inlineData(base64 이미지/PDF/오디오/비디오)를 혼합할 수 있습니다 |
systemInstruction | object | 시스템 지시 | |
generationConfig.thinkingConfig.thinkingLevel | string | minimal / low / medium / high, 0/403/487/837 추론 token으로 측정됩니다 | |
generationConfig.thinkingConfig.includeThoughts | bool | 생각 부분(thought: true)을 에코합니다 | |
generationConfig.responseMimeType + responseSchema | 구조화된 출력(JSON Schema) | ||
tools | array | google_search / url_context / codeExecution / google_maps / functionDeclarations |
응답 참고사항
- 추론 사용량은
usageMetadata.thoughtsTokenCount입니다(출력으로 청구됩니다) - 근거 출처는
candidates[0].groundingMetadata에 표시되며; URL 컨텍스트는urlContextMetadata에 표시됩니다 - 암시적 캐시 적중은
usageMetadata.cachedContentTokenCount에 표시됩니다(확률적이므로 — 이에 의존하지 마십시오)
인증
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