Get API Key Get API
Docs

Gemini Native Format

- Call Gemini models using Google Native API format

  • Synchronous processing mode with real-time response
  • Minimal parameters for quick start

Request example

curl --request POST \
  --url https://api.openveer.com/v1beta/models/gemini-2.5-pro:generateContent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Hello, please introduce yourself"
        }
      ]
    }
  ]
}'

Response example

{
  "code": 200,
  "data": {
    "candidates": [
      {
        "content": {
          "role": "model",
          "parts": [
            {
              "text": "Hello! I'm pleased to introduce myself.\n\nI am a large language model, trained and developed by Google..."
            }
          ]
        },
        "finishReason": "STOP",
        "index": 0,
        "safetyRatings": [
          {
            "category": "HARM_CATEGORY_HATE_SPEECH",
            "probability": "NEGLIGIBLE"
          }
        ]
      }
    ],
    "promptFeedback": {
      "safetyRatings": [
        {
          "category": "HARM_CATEGORY_HATE_SPEECH",
          "probability": "NEGLIGIBLE"
        }
      ]
    ]
  },
  "usageMetadata": {
    "promptTokenCount": 4,
    "candidatesTokenCount": 611,
    "totalTokenCount": 2422,
    "thoughtsTokenCount": 1807,
    "promptTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 4
      }
    ]
  }
}

Authorizations

Authorization string

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

model string

Model name

The examples use gemini-2.5-pro, which you can replace with other supported Gemini models:

  • gemini-3.5-flash - Gemini 3.5 Flash
  • gemini-3.1-pro-preview - Gemini 3.1 Pro Preview
  • gemini-3-pro-preview - Gemini 3 Pro Preview
  • gemini-2.5-pro - Gemini 2.5 Pro
method string

" required>
Generation method (recommended: generateContent for quick start):

  • generateContent: Wait for complete response and return at once
  • streamGenerateContent: Stream response, return content in chunks

Available options: generateContent, streamGenerateContent

Body

contents array
List of conversation contents Minimum 1 message required
role string

Role type:

  * user: User message
  * model: Model response (used in conversation history)
parts array
Message content parts
text string

Text content

inlineData object
Inline data (for multimodal input)
mimeType string

MIME type, e.g. image/jpeg, image/png

data string

Base64 encoded data

fileData object
Provide multimodal content, such as video, through a file URI.
mimeType string

File MIME type, such as video/mp4.

fileUri string

File URI, such as an HTTP(S) URL for a video file.

Use fileData to provide the video URL and MIME type, and include an analysis prompt in the same message. This example asks the model to list the main events in chronological order with timestamps.
curl 'https://api.openveer.com/v1beta/models/gemini-3.1-pro-preview:generateContent' \
  -H 'Authorization: Bearer YOUR_APIMART_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "fileData": {
              "mimeType": "video/mp4",
              "fileUri": "https://storage.googleapis.com/cloud-samples-data/generative-ai/video/pixel8.mp4"
            }
          },
          {
            "text": "Analyze the video, list the main events in chronological order, and include timestamps."
          }
        ]
      }
    ],
    "generationConfig": {
      "maxOutputTokens": 2048
    }
  }'
Example:
[
  {
    "role": "user",
    "parts": [{ "text": "Hello, please introduce yourself" }]
  }
]
generationConfig object
Generation configuration (optional)
temperature number

Controls output randomness, range 0.0-2.0

  * Lower values make output more deterministic
  * Higher values make output more random

  Default: 1.0
maxOutputTokens integer

Maximum number of tokens to generate

  Different models have different maximum limits
topP number

Nucleus sampling parameter, range 0.0-1.0

  Controls the probability mass considered during sampling
topK integer

Top-K sampling parameter

  Sample only from the K most probable tokens at each step
stopSequences array

List of stop sequences

  Stop generation when these sequences are encountered
safetySettings array
Safety settings (optional)
category string

Safety category:

  * HARM_CATEGORY_HATE_SPEECH: Hate speech
  * HARM_CATEGORY_DANGEROUS_CONTENT: Dangerous content
  * HARM_CATEGORY_HARASSMENT: Harassment
  * HARM_CATEGORY_SEXUALLY_EXPLICIT: Sexually explicit content
threshold string

Threshold level:

  * BLOCK_NONE: Don't block
  * BLOCK_ONLY_HIGH: Block only high risk
  * BLOCK_MEDIUM_AND_ABOVE: Block medium and above risk
  * BLOCK_LOW_AND_ABOVE: Block low and above risk

Response

candidates array
List of candidate responses
content object
Generated content
role string

Role, typically model

parts array
List of content parts
text string

Generated text content

finishReason string

Finish reason:

  * STOP: Normal completion
  * MAX_TOKENS: Maximum token limit reached
  * SAFETY: Stopped for safety reasons
  * RECITATION: Stopped due to recitation
  * OTHER: Other reasons
index integer

Index of the candidate response

safetyRatings array
List of safety ratings
category string

Safety category

probability string

Probability level: NEGLIGIBLE, LOW, MEDIUM, HIGH

promptFeedback object
Prompt feedback information
safetyRatings array

Safety ratings for the prompt

blockReason string

Block reason (if prompt was blocked)

usageMetadata object
Usage statistics
promptTokenCount integer

Number of tokens in the prompt

candidatesTokenCount integer

Number of tokens in candidate responses

totalTokenCount integer

Total number of tokens consumed

thoughtsTokenCount integer

Number of tokens used for thinking (if applicable)

promptTokensDetails array
Prompt token details
modality string

Modality type: TEXT, IMAGE, etc.

tokenCount integer

Number of tokens for this modality

This documentation is built and hosted on Mintlify, a developer documentation platform.