Google GenAI SDK (Python)
MarkdownSDK · Gemini
Full guide
| Format | Where to set it up |
|---|---|
| Gemini | genai.Client(api_key=..., http_options=types.HttpOptions(base_url=...)) |
Setup
Copy the configuration and replace sk-... with your key from the Ailoot Dashboard. Prefer storing the key in the environment variable AILOOT_API_KEY, if the application supports it.
Before starting, request GET /v1/models with your Ailoot key. Choose an exact model ID whose methods include POST /v1beta/models/{model}:generateContent, then use that ID in the configuration. For agents, also check tool support and the features required by your client version.
import os
from google import genai
from google.genai import types
client = genai.Client(
api_key=os.environ["AILOOT_API_KEY"],
http_options=types.HttpOptions(base_url="https://api.ailoot.ai"))
r = client.models.generate_content(model="gemini-3.6-flash", contents="Hello")
print(r.text)Example model: gemini-3.6-flash, gemini-3.1-pro. Choose any other model from the catalog — check that it supports the format you need.
Good to know
Test
- For the Gemini format, the URL is
https://api.ailoot.aiwithout/v1beta. - Ask a short question. If you get an error, check the code and Request ID, then consult Errors and limits.
404:https://api.ailoot.ai→/v1beta/models/{model}:generateContent. Before starting, request GET /v1/models with your Ailoot key. Choose an exact model ID whose methods include POST /v1beta/models/{model}:generateContent, then use that ID in the configuration. For agents, also check tool support and the features required by your client version.- 402 — insufficient balance for the reserve. Agents reserve more than chat: why.
Application documentation: https://github.com/googleapis/python-genai#custom-base-url
Still have questions? Send your Request ID and a description — we'll help you troubleshoot.Contact support