Gemini Native

Use Google Gemini's native protocol directly. If you already have code built on the official Gemini SDK, just point the request URL at the gateway. You can also call Gemini models through the OpenAI-compatible Chat Completions endpoint.

POST https://apicdn.xyc.ai/v1beta/models/{model}:generateContent
Different Auth Header

The Gemini native protocol uses the x-goog-api-key header, or the URL query parameter ?key=sk-xxxxxxxx.

Request Example

curl "https://apicdn.xyc.ai/v1beta/models/gemini-3-pro-preview:generateContent" \
  -H "x-goog-api-key: sk-xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"parts": [{"text": "Introduce yourself in one sentence."}]}
    ]
  }'

Streaming

Use the :streamGenerateContent action for streaming output:

https://apicdn.xyc.ai/v1beta/models/gemini-3-pro-preview:streamGenerateContent

Available Models

Common Gemini model names under the native protocol: gemini-3.1-pro-preview, gemini-3-pro-preview, gemini-3-flash-preview, gemini-2.5-pro, gemini-2.5-flash. See the full list at Models.

Response Structure

{
  "candidates": [
    {
      "content": {"parts": [{"text": "..."}], "role": "model"},
      "finishReason": "STOP"
    }
  ],
  "usageMetadata": {"promptTokenCount": 8, "candidatesTokenCount": 20}
}