Skip to main content
POST
/
models
/
v2
/
google
/
{model}
Google
curl --request POST \
  --url https://api.bytez.com/models/v2/google/{model} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'provider-key: <api-key>' \
  --data '
{
  "text": "<string>",
  "messages": [
    {
      "content": "<string>"
    }
  ],
  "url": "<string>",
  "base64": "<string>",
  "question": "<string>",
  "context": "<string>",
  "candidate_labels": [
    "<string>"
  ],
  "stream": true,
  "json": true,
  "params": {
    "min_length": 123,
    "max_length": 123,
    "temperature": 123
  }
}
'
import requests

url = "https://api.bytez.com/models/v2/google/{model}"

payload = {
"text": "<string>",
"messages": [{ "content": "<string>" }],
"url": "<string>",
"base64": "<string>",
"question": "<string>",
"context": "<string>",
"candidate_labels": ["<string>"],
"stream": True,
"json": True,
"params": {
"min_length": 123,
"max_length": 123,
"temperature": 123
}
}
headers = {
"Authorization": "<api-key>",
"provider-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
Authorization: '<api-key>',
'provider-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: '<string>',
messages: [{content: '<string>'}],
url: '<string>',
base64: '<string>',
question: '<string>',
context: '<string>',
candidate_labels: ['<string>'],
stream: true,
json: true,
params: {min_length: 123, max_length: 123, temperature: 123}
})
};

fetch('https://api.bytez.com/models/v2/google/{model}', 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.bytez.com/models/v2/google/{model}",
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([
'text' => '<string>',
'messages' => [
[
'content' => '<string>'
]
],
'url' => '<string>',
'base64' => '<string>',
'question' => '<string>',
'context' => '<string>',
'candidate_labels' => [
'<string>'
],
'stream' => true,
'json' => true,
'params' => [
'min_length' => 123,
'max_length' => 123,
'temperature' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"provider-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.bytez.com/models/v2/google/{model}"

payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"url\": \"<string>\",\n \"base64\": \"<string>\",\n \"question\": \"<string>\",\n \"context\": \"<string>\",\n \"candidate_labels\": [\n \"<string>\"\n ],\n \"stream\": true,\n \"json\": true,\n \"params\": {\n \"min_length\": 123,\n \"max_length\": 123,\n \"temperature\": 123\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<api-key>")
req.Header.Add("provider-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.bytez.com/models/v2/google/{model}")
.header("Authorization", "<api-key>")
.header("provider-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"url\": \"<string>\",\n \"base64\": \"<string>\",\n \"question\": \"<string>\",\n \"context\": \"<string>\",\n \"candidate_labels\": [\n \"<string>\"\n ],\n \"stream\": true,\n \"json\": true,\n \"params\": {\n \"min_length\": 123,\n \"max_length\": 123,\n \"temperature\": 123\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.bytez.com/models/v2/google/{model}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["provider-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\"\n }\n ],\n \"url\": \"<string>\",\n \"base64\": \"<string>\",\n \"question\": \"<string>\",\n \"context\": \"<string>\",\n \"candidate_labels\": [\n \"<string>\"\n ],\n \"stream\": true,\n \"json\": true,\n \"params\": {\n \"min_length\": 123,\n \"max_length\": 123,\n \"temperature\": 123\n }\n}"

response = http.request(request)
puts response.read_body
{
  "error": null,
  "output": "<string>"
}

Authorizations

Authorization
string
header
required

Set Authorization header to BYTEZ_KEY (e.g. 'Authorization': 'Key ABC123')

provider-key
string
header
required

Set provider-key header to PROVIDER_KEY (e.g. 'provider-key': 'OPEN_AI_KEY')

Path Parameters

model
string
required

The specific Google model to interact with (e.g., gemini-1.5-flash).

Body

application/json

Universal schema that supports text, chat, image, audio, video, QA, zero-shot, and more.

text
string

Input text for NLP tasks.

messages
object[]

Conversation history.

url
string<uri>

URL to image/audio/video.

base64
string

Base64-encoded image/audio/video.

question
string

Question (for QA tasks).

context
string

Context paragraph (for QA tasks).

candidate_labels
string[]

Candidate labels (for zero-shot).

stream
boolean

Enable/disable text streaming.

json
boolean

Stream media instead of JSON.

params
object

Model-specific parameters.

Response

200 - application/json

Successful response from the model.

error
string

Null if everything is fine

Example:

null

output

Model output