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

# API nativa Gemini

> Usa OmniaKey con Gemini Generate Content e gli SDK Google Gen AI.

Usa questa base URL HTTP grezza per le richieste native Gemini:

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

## Generate Content

L'ID del modello fa parte del percorso dell'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]
>
> L'SDK Google Gen AI usa per impostazione predefinita la versione API Gemini
> `v1beta`, quindi gli esempi SDK passano il solo host come `base_url`. Le
> chiamate HTTP grezze includono `/v1beta` nel percorso dell'URL.

## Modelli

Usa `GET /v1beta/models` per la scoperta nativa dei modelli Gemini. Il catalogo
selezionato e leggibile da una persona è in [Modelli supportati](https://docs.omniakey.com/it/models.md).

## Modelli Gemini tramite strumenti compatibili OpenAI

Se il tuo strumento supporta solo endpoint compatibili OpenAI, usa
`https://api.omniakey.com/v1` e passa un ID Gemini come `gemini-3.1-pro-preview` a
Chat Completions.


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