> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omniakey.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini 原生 API

> 通过 OmniaKey 使用 Gemini Generate Content 和 Google Gen AI SDK。

原始 HTTP 请求使用这个 Gemini 原生 base URL：

```text theme={null}
https://api.omniakey.com/v1beta
```

## Generate Content

模型 id 在 URL path 中：

```text theme={null}
POST /v1beta/models/{model}:generateContent
```

```bash theme={null}
curl "https://api.omniakey.com/v1beta/models/gemini-3.1-pro-preview:generateContent" \
  -H "Authorization: Bearer your-omniakey-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [{"text": "Explain what a race condition is."}]}]
  }'
```

如果工具只支持 OpenAI 兼容协议，也可以使用 `https://api.omniakey.com/v1`
并传入 Gemini model id。

<Note>
  Google Gen AI SDK 默认使用 Gemini `v1beta` API 版本，所以 SDK 示例通常把裸域名
  `https://api.omniakey.com` 作为 `base_url`；原始 HTTP 请求则在 URL 中包含
  `/v1beta`。
</Note>

## 模型列表

`GET /v1beta/models` 可用于 Gemini 原生模型发现。可读模型目录见 [支持模型](/cn/models)。
