> ## 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

> Gemini Generate Content と Google Gen AI SDK で OmniaKey を使う。

Gemini ネイティブのリクエストには、この生の HTTP Base URL を使います。

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

## Generate Content

モデル ID は URL パスの一部になります。

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

```bash cURL 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": "Refactor this function for readability."}]}]
  }'
```

```python Python theme={null}
from google import genai
from google.genai import types

client = genai.Client(
    api_key="your-omniakey-api-key",
    http_options=types.HttpOptions(base_url="https://api.omniakey.com"),
)

response = client.models.generate_content(
    model="gemini-3.1-pro-preview",
    contents="Refactor this function for readability.",
)

print(response.text)
```

> [!NOTE]
>
> Google Gen AI SDK は既定で Gemini の `v1beta` API バージョンを使うため、SDK の例では
> `base_url` にホスト名だけを指定します。生の HTTP 呼び出しでは URL パスに `/v1beta` を
> 含めます。

## モデル一覧

Gemini ネイティブのモデル一覧には `GET /v1beta/models` を使います。人が読むための厳選
カタログは [対応モデル](https://docs.omniakey.com/ja/models.md)を参照してください。

## OpenAI 互換ツールから Gemini モデルを使う

お使いのツールが OpenAI 互換のエンドポイントしか対応していない場合は、
`https://api.omniakey.com/v1` を使い、Chat Completions に `gemini-3.1-pro-preview` のような
Gemini のモデル ID を渡します。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.