Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.gmicloud.ai/llms.txt

Use this file to discover all available pages before exploring further.

Model ID
google/gemini-3-flash-preview

API Usage

You can interact with the Gemini 3 Flash Preview model through our OpenAI-compatible APIs and Gemini native APIs. Below are examples showing how to use the model’s API.

API Examples

Generate a model response using the chat endpoint of Gemini 3 Flash Preview.

Shell

curl --request POST \
  --url https://api.gmi-serving.com/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer *************' \
  --data '{
    "model": "google/gemini-3-flash-preview",
    "messages": [
      {"role": "system", "content": "You are a helpful AI assistant"},
      {"role": "user", "content": "List 3 countries and their capitals."}
    ],
    "temperature": 0,
    "max_tokens": 500
  }'

example for function call

# example for function call
curl --request POST \
  --url https://api.gmi-serving.com/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer *************' \
  --data '{
    "temperature": 0,
    "max_tokens": 200,
    "model": "google/gemini-3-flash-preview",
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "get_weather",
                "description": "Get weather in a location",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "location": {
                            "type": "string",
                            "description": "The city, e.g. San Francisco"
                        }
                    },
                    "required": [
                        "location"
                    ]
                }
            }
        }
    ],
    "messages": [
        {
            "role": "user",
            "content": "What is the weather in San Francisco?"
        }
    ]
}'

example for vision (image input)

### example for vision (image input)
curl --request POST \
  --url https://api.gmi-serving.com/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer *************' \
  --data '{
    "model": "google/gemini-3-flash-preview",
    "messages": [{
      "role": "user",
      "content": [
        {"type": "text", "text": "What animal is in this image?"},
        {"type": "image_url", "image_url": {"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Cat_November_2010-1a.jpg/220px-Cat_November_2010-1a.jpg"}}
      ]
    }],
    "max_tokens": 100
  }'

example for video input

curl --request POST \
  --url https://api.gmi-serving.com/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer *************' \
  --data '{
    "model": "google/gemini-3-flash-preview",
    "messages": [{
      "role": "user",
      "content": [
        {"type": "text", "text": "Describe this video."},
        {"type": "video_url", "video_url": {"url": "gs://cloud-samples-data/generative-ai/video/pixel8.mp4"}}
      ]
    }],
    "max_tokens": 1000
  }'

Gemini Native API

basic generateContent

curl --request POST \
  --url https://api.gmi-serving.com/v1/models/gemini-3-flash-preview:generateContent \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer *************' \
  --data '{
    "contents": [
      {
        "role": "user",
        "parts": [{"text": "List 3 countries and their capitals."}]
      }
    ]
  }'

example for video input (Gemini Native)

curl --request POST \
  --url https://api.gmi-serving.com/v1/models/gemini-3-flash-preview:generateContent \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer *************' \
  --data '{
    "contents": [{
      "role": "user",
      "parts": [
        {"text": "Describe this video."},
        {"fileData": {"mimeType": "video/mp4", "fileUri": "gs://cloud-samples-data/generative-ai/video/pixel8.mp4"}}
      ]
    }]
  }'

Python

import requests
import json

url = "https://api.gmi-serving.com/v1/chat/completions"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer *************"
}

payload = {
    "model": "google/gemini-3-flash-preview",
    "messages": [
        {"role": "system", "content": "You are a helpful AI assistant"},
        {"role": "user", "content": "List 3 countries and their capitals."}
    ],
    "temperature": 0,
    "max_tokens": 500
}

response = requests.post(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=2))

Google Vertex SDK

from google import genai
from google.genai import types

client = genai.Client(
    vertexai=True,
    http_options={
        "base_url": "https://api.gmi-serving.com/v1/models/gemini-3-flash-preview:generateContent",
        "headers": {
            "Authorization": "Bearer <GMI_API_KEY>"
        }
    }
)

video_config = types.GenerateContentConfig(
    system_instruction="You are a professional action analyst. Please answer in Spanish.",
)
video_part = types.Part.from_uri(
    file_uri="gs://cloud-samples-data/generative-ai/video/pixel8.mp4",
    mime_type="video/mp4"
)
video_metadata_part = types.Part(video_metadata=types.VideoMetadata(fps=10.0))
try:
    response = client.models.generate_content(
        model="google/gemini-3-flash-preview",
        contents=["Describe this video.", video_part, video_metadata_part],
        config=video_config
    )
    print("--- Gemini 3 Flash reply ---")
    print(response.text)
except Exception as e:
    print(f"Failed: {e}")