Back to OmniaKey

Gemini

en-api-gemini-native.md

latest1.5 KB
Original Source

Use this raw HTTP base URL for Gemini-native requests:

https://api.omniakey.com/v1beta

Generate Content

The model id is part of the URL path:

POST /v1beta/models/{model}:generateContent

cURL

Python

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."}]}]
  }'
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)

The Google Gen AI SDK defaults to the Gemini v1beta API version, so SDK examples use the bare host as base_url. Raw HTTP calls include /v1beta in the URL path.

Models

Use GET /v1beta/models for Gemini-native model discovery. For the curated human-readable catalog, see Supported Models.

Gemini models through OpenAI-compatible tools

If your tool only supports OpenAI-compatible endpoints, use https://api.omniakey.com/v1 and pass a Gemini model id such as gemini-3.1-pro-preview to Chat Completions.

Anthropic-native APISupported Models

⌘I