Chat completion: Gemini 3.6 Flash (OpenAI-compatible)
curl --request POST \
--url https://api.apiyi.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gemini-3.6-flash",
"messages": [
{
"role": "user",
"content": "Introduce yourself in one sentence"
}
]
}
'import requests
url = "https://api.apiyi.com/v1/chat/completions"
payload = {
"model": "gemini-3.6-flash",
"messages": [
{
"role": "user",
"content": "Introduce yourself in one sentence"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gemini-3.6-flash',
messages: [{role: 'user', content: 'Introduce yourself in one sentence'}]
})
};
fetch('https://api.apiyi.com/v1/chat/completions', 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/v1/chat/completions",
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([
'model' => 'gemini-3.6-flash',
'messages' => [
[
'role' => 'user',
'content' => 'Introduce yourself in one sentence'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.apiyi.com/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"choices": [
{
"message": {
"role": "<string>",
"content": "<string>",
"tool_calls": [
{}
]
},
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}Gemini 3.6 Flash
Gemini 3.6 Flash Chat API 레퍼런스
Gemini 3.6 Flash Chat Completions API 레퍼런스 및 대화형 플레이그라운드: OpenAI 호환, reasoning_effort 단계, 스트리밍, 함수 호출, 비전을 지원합니다.
POST
/
v1
/
chat
/
completions
Chat completion: Gemini 3.6 Flash (OpenAI-compatible)
curl --request POST \
--url https://api.apiyi.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gemini-3.6-flash",
"messages": [
{
"role": "user",
"content": "Introduce yourself in one sentence"
}
]
}
'import requests
url = "https://api.apiyi.com/v1/chat/completions"
payload = {
"model": "gemini-3.6-flash",
"messages": [
{
"role": "user",
"content": "Introduce yourself in one sentence"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gemini-3.6-flash',
messages: [{role: 'user', content: 'Introduce yourself in one sentence'}]
})
};
fetch('https://api.apiyi.com/v1/chat/completions', 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/v1/chat/completions",
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([
'model' => 'gemini-3.6-flash',
'messages' => [
[
'role' => 'user',
'content' => 'Introduce yourself in one sentence'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.apiyi.com/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gemini-3.6-flash\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"choices": [
{
"message": {
"role": "<string>",
"content": "<string>",
"tool_calls": [
{}
]
},
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}오른쪽 플레이그라운드를 사용하십시오:
Bearer sk-your-api-key를 Authorization에 넣으십시오. 기본 예제는 reasoning_effort: "low"를 사용합니다. 전송하여 응답을 확인하십시오.Thinking은 기본적으로 ON입니다(출력으로 과금됩니다). 디버깅할 때는 low로 유지하십시오. 복잡한 작업에는
max_tokens가 4000+일 때 high로 전환하십시오. 검색 grounding, code execution 및 기타 네이티브 tools는 이 엔드포인트에서 사용할 수 없습니다 — 대신 Native Playground을 사용하십시오. 개요 및 측정 데이터: Gemini 3.6 Flash Overview.매개변수 빠른 참조
| 매개변수 | 유형 | 필수 | 비고 |
|---|---|---|---|
model | string | ✓ | 고정값: gemini-3.6-flash |
messages | array | ✓ | 표준 OpenAI 메시지; content는 멀티모달 배열일 수 있습니다(image_url는 data URL을 지원합니다) |
max_tokens | int | 출력 쿼터; thinking이 켜진 경우 2000 이상 권장(thinking은 출력으로 과금됨) | |
reasoning_effort | string | low / medium / high thinking 단계, 작동 확인됨 | |
stream | bool | SSE 스트리밍 | |
response_format | object | json_schema 구조화 출력, 작동 확인됨 | |
tools | array | Function-calling 도구 목록, 작동 확인됨 |
응답 참고사항
- 추론 사용량은
usage.completion_tokens_details.reasoning_tokens입니다(이 모델에 대해 보고됩니다) - 이 엔드포인트에서는 Thinking text(reasoning_content)가 다시 출력되지 않습니다 - 네이티브 엔드포인트의
includeThoughts를 사용하여 생각을 확인하십시오 - 모델 이름
gemini-3.6-flash를 다시 확인하십시오 - 오타가 있으면 조용한 대체 동작 대신 오류가 반환됩니다
인증
Add Authorization: Bearer YOUR_API_KEY header
본문
application/json
Fixed: gemini-3.6-flash
Standard OpenAI messages array
Show child attributes
Show child attributes
Output quota; 2000+ recommended with thinking on (thinking bills as output)
SSE streaming
Thinking tier
사용 가능한 옵션:
low, medium, high Structured output, json_schema supported
Function-calling tool list
이 페이지가 도움이 되었나요?
⌘I