Gemini Native Format
curl --request POST \
--url https://api.poyo.ai:{method}/v1beta/models/{model}:62437 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Summarize the 'new night mode' requirements in 3 points and provide next steps."
}
]
}
]
}
EOFimport requests
url = "https://api.poyo.ai:{method}/v1beta/models/{model}:62437"
payload = { "contents": [
{
"role": "user",
"parts": [{ "text": "Summarize the 'new night mode' requirements in 3 points and provide next steps." }]
}
] }
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({
contents: [
{
role: 'user',
parts: [
{
text: 'Summarize the \'new night mode\' requirements in 3 points and provide next steps.'
}
]
}
]
})
};
fetch('https://api.poyo.ai:{method}/v1beta/models/{model}:62437', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "https://api.poyo.ai:{method}/v1beta/models/{model}:62437",
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' => 'Summarize the \'new night mode\' requirements in 3 points and provide next steps.'
]
]
]
]
]),
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.poyo.ai:{method}/v1beta/models/{model}:62437"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Summarize the 'new night mode' requirements in 3 points and provide next steps.\"\n }\n ]\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.poyo.ai:{method}/v1beta/models/{model}:62437")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Summarize the 'new night mode' requirements in 3 points and provide next steps.\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.poyo.ai:{method}/v1beta/models/{model}:62437")
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 \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Summarize the 'new night mode' requirements in 3 points and provide next steps.\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Hello! I'm pleased to introduce myself."
}
]
},
"finishReason": "STOP",
"index": 0
}
],
"promptFeedback": {
"safetyRatings": [
{
"category": "HARM_CATEGORY_HATE_SPEECH",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_HARASSMENT",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
"probability": "NEGLIGIBLE"
}
]
}
},
"usageMetadata": {
"promptTokenCount": 15,
"candidatesTokenCount": 29,
"totalTokenCount": 44,
"thoughtsTokenCount": 0,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 15
}
]
}
}Gemini
Gemini Native Format
Call Gemini models using Google Native API format
POST
/
v1beta
/
models
/
{model}
:
{method}
Gemini Native Format
curl --request POST \
--url https://api.poyo.ai:{method}/v1beta/models/{model}:62437 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Summarize the 'new night mode' requirements in 3 points and provide next steps."
}
]
}
]
}
EOFimport requests
url = "https://api.poyo.ai:{method}/v1beta/models/{model}:62437"
payload = { "contents": [
{
"role": "user",
"parts": [{ "text": "Summarize the 'new night mode' requirements in 3 points and provide next steps." }]
}
] }
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({
contents: [
{
role: 'user',
parts: [
{
text: 'Summarize the \'new night mode\' requirements in 3 points and provide next steps.'
}
]
}
]
})
};
fetch('https://api.poyo.ai:{method}/v1beta/models/{model}:62437', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "https://api.poyo.ai:{method}/v1beta/models/{model}:62437",
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' => 'Summarize the \'new night mode\' requirements in 3 points and provide next steps.'
]
]
]
]
]),
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.poyo.ai:{method}/v1beta/models/{model}:62437"
payload := strings.NewReader("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Summarize the 'new night mode' requirements in 3 points and provide next steps.\"\n }\n ]\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.poyo.ai:{method}/v1beta/models/{model}:62437")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Summarize the 'new night mode' requirements in 3 points and provide next steps.\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.poyo.ai:{method}/v1beta/models/{model}:62437")
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 \"contents\": [\n {\n \"role\": \"user\",\n \"parts\": [\n {\n \"text\": \"Summarize the 'new night mode' requirements in 3 points and provide next steps.\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Hello! I'm pleased to introduce myself."
}
]
},
"finishReason": "STOP",
"index": 0
}
],
"promptFeedback": {
"safetyRatings": [
{
"category": "HARM_CATEGORY_HATE_SPEECH",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_HARASSMENT",
"probability": "NEGLIGIBLE"
},
{
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
"probability": "NEGLIGIBLE"
}
]
}
},
"usageMetadata": {
"promptTokenCount": 15,
"candidatesTokenCount": 29,
"totalTokenCount": 44,
"thoughtsTokenCount": 0,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 15
}
]
}
}- Call Gemini models using Google Native API format
- Supports synchronous and streaming generation methods
- Minimal parameters for quick start
Usage Examples
Generate Content
Endpoint:POST /v1beta/models/gemini-3-flash-preview:generateContent
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Summarize the goals of the new night mode in one sentence."
}
]
}
],
"generationConfig": {
"maxOutputTokens": 256,
"temperature": 0.7
}
}
Stream Generate Content
Endpoint:POST /v1beta/models/gemini-3-flash-preview:streamGenerateContent
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Generate 5 short feature names for an AI writing assistant."
}
]
}
],
"generationConfig": {
"maxOutputTokens": 256
}
}
Multimodal Input
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Describe the image and write concise alt text."
},
{
"inlineData": {
"mimeType": "image/png",
"data": "BASE64_IMAGE_DATA"
}
}
]
}
]
}
Notes
- Use
generateContentfor complete JSON responses. - Use
streamGenerateContentfor streaming generation. - Put text instructions before multimodal parts when possible.
Authorizations
All API endpoints require Bearer Token authentication.
Get your API Key:
Visit the API Key Management Page to get your API Key
Add it to the request header:
Authorization: Bearer YOUR_API_KEY
Path Parameters
Gemini model name. Example: gemini-3-flash-preview.
Example:
"gemini-3-flash-preview"
Request method. Use generateContent for complete JSON responses and streamGenerateContent for streaming generation.
Available options:
generateContent, streamGenerateContent Example:
"generateContent"
Body
application/json
Conversation contents with roles and parts. Each content object may include a role (user or model) and a parts array containing text or inline data.
Show child attributes
Show child attributes
Generation configuration, including temperature, topP, topK, maxOutputTokens, and stopSequences.
Show child attributes
Show child attributes
Safety settings.
Show child attributes
Show child attributes
