1. Gemini
TikHub-AI-Proxy
  • Overview (PLEASE READ)
  • Streaming API
  • OpenAI
    • OpenAI response
      POST
    • OpenAI embeddings
      POST
    • OpenAI audio transcription
      POST
    • OpenAI chat completion
      POST
  • Claude
    • Claude chat completion
      POST
    • Claude message
      POST
  • DeepSeek
    • DeepSeek chat completion
      POST
  • Sora
    • Sora video generation
      POST
    • Get Sora video status
      GET
    • Download Sora video content
      GET
    • Remix Sora video
      POST
    • List Sora videos
      GET
    • Delete Sora video
      DELETE
  • Gemini
    • Gemini content
      POST
  • Seedance
    • Seedance video generation
      POST
    • Retrieve Seedance task
      GET
  • Kling
    • Kling text-to-video
      POST
    • Retrieve Kling text-to-video task
      GET
    • Kling image-to-video
      POST
    • Retrieve Kling image-to-video task
      GET
  • Veo
    • Veo video generation
    • Fetch Veo video generation status
  • Schemas
    • ChatCompletionRequest
    • ChatMessage
    • Tool
    • ToolCall
    • ChatCompletionResponse
    • ChatCompletionChoice
    • ContentFilterResults
    • UsageInfo
    • EmbeddingRequest
    • EmbeddingResponse
    • TranscriptionRequest
    • TranscriptionResponse
    • ClaudeMessageRequest
    • ClaudeMessageResponse
    • VideoCreateRequest
    • VideoResponse
    • VideoRemixRequest
    • GeminiGenerateContentRequest
    • VideoListResponse
    • GeminiContent
    • VideoDeleteResponse
    • GeminiGenerationConfig
    • ResponseRequest
    • GeminiGenerateContentResponse
    • ResponseObject
    • SeedanceTaskRequest
    • SeedanceTaskCreateResponse
    • SeedanceTaskResponse
    • KlingText2VideoRequest
    • KlingImage2VideoRequest
    • KlingTaskResponse
    • KlingTaskDetailResponse
    • KlingTaskListResponse
    • VeoGenerateRequest
    • VeoOperationResponse
    • VeoFetchOperationRequest
    • VeoFetchOperationResponse
  1. Gemini

Gemini content

POST
https://ai.tikhub.io/v1beta/models/{model}:generateContent
Gemini
Generates a model response given an input using Google Gemini models. Supports text chat and image generation capabilities.

How To Use#

Simply specify the model name in your request payload. All other parameters remain the same across different models.

Supported Models#

Text/Chat Models#

gemini-2.5-flash
gemini-2.5-pro
gemini-3-pro-preview
gemini-3-flash-preview

Image Generation Models#

gemini-2.5-flash-image-preview
gemini-3-pro-image-preview

Authentication#

Use x-goog-api-key header for authentication.

Image Generation#

For image generation, set generationConfig.responseModalities to ["image", "text"].

Request

Authorization
API Key
Add parameter in header
x-goog-api-key
Example:
x-goog-api-key: ********************
or
Path Params

Body Params application/jsonRequired

Examples
{
    "contents": [
        {
            "role": "user",
            "parts": [
                {
                    "text": "Hi, what model are you?"
                }
            ]
        }
    ],
    "generationConfig": {
        "temperature": 0.7,
        "maxOutputTokens": 1024
    }
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://ai.tikhub.io/v1beta/models/gemini-2.5-flash:generateContent' \
--header 'x-goog-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "contents": [
        {
            "role": "user",
            "parts": [
                {
                    "text": "Hi, what model are you?"
                }
            ]
        }
    ],
    "generationConfig": {
        "temperature": 0.7,
        "maxOutputTokens": 1024
    }
}'

Responses

🟢200OK
application/json
Content generated successfully
Body

Example
{
    "candidates": [
        {
            "content": {
                "parts": [
                    {
                        "text": "I am Gemini, a large language model created by Google."
                    }
                ],
                "role": "model"
            },
            "finishReason": "STOP",
            "index": 0,
            "safetyRatings": [
                {
                    "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
                    "probability": "NEGLIGIBLE"
                },
                {
                    "category": "HARM_CATEGORY_HATE_SPEECH",
                    "probability": "NEGLIGIBLE"
                },
                {
                    "category": "HARM_CATEGORY_HARASSMENT",
                    "probability": "NEGLIGIBLE"
                },
                {
                    "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
                    "probability": "NEGLIGIBLE"
                }
            ]
        }
    ],
    "usageMetadata": {
        "promptTokenCount": 6,
        "candidatesTokenCount": 12,
        "totalTokenCount": 18
    },
    "modelVersion": "gemini-2.5-flash"
}
🟠400Bad Request
🟠401Unauthorized
🟠429Too Many Requests
🔴500Internal Server Error
Modified at 2026-03-02 20:33:07
Previous
Delete Sora video
Next
Seedance video generation
Built with