Google GenAI SDK
On this page
Use the Google GenAI SDK unchanged. Set the base URL to the Gateway, authenticate with x-goog-api-key (the SDK default), and call any model returned by GET /v1/models.
Configure the client#
from google import genai
client = genai.Client(
api_key="atp-...",
http_options={"base_url": "https://api.atptoken.ai"},
)
r = client.models.generate_content(
model="<model from GET /v1/models>",
contents="hi",
)
print(r.text)Supported routes#
The generateContent and streamGenerateContent routes work under both /v1 and /v1beta (the SDK default). Full endpoint reference: /v1/models/{model}:generateContent.
Next steps
Was this page helpful?