Google Gemini
Route Gemini through Sentisec with a Google AI Studio API key. OpenAI-compatible wire, automatic routing on the model id.
Gemini is the fastest Google model to put behind Sentisec: one API key from Google AI Studio, no cloud project, no service account. Sentisec speaks Gemini's OpenAI-compatible chat-completions surface, so any OpenAI-shaped client works with a base-URL change and nothing else.
If your deployment needs to live inside a Google Cloud project — your own IAM, region, and billing — use Vertex AI instead.
Setup
Get an API key from
aistudio.google.com. It looks like
AIza….
Add it to your workspace. In the dashboard, open Settings → Providers. Under Provider keys, choose Add Gemini key on the Google Gemini API card and paste the key exactly as Google gave it to you — no wrapper, no JSON.
Mint a Sentisec API key. Settings → API keys → Issue key.
Format: sk_sentisec_<8>_<32>.
Point your client at your workspace endpoint.
export OPENAI_BASE_URL=https://api.sentisec.ch/ws/<your-workspace-id>/v1
export OPENAI_API_KEY=$SENTISEC_API_KEYThe credential takes effect on your next request — nothing to restart.
First call
Any model id starting with gemini- routes to Gemini automatically. No
header needed.
curl -X POST https://api.sentisec.ch/ws/<your-workspace-id>/v1/chat/completions \
-H "Authorization: Bearer $SENTISEC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.6-flash",
"messages": [{"role": "user", "content": "hi"}]
}'The response is the standard OpenAI Chat Completions body, and the session appears under Sessions in the dashboard.
OpenAI SDKs
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.sentisec.ch/ws/<your-workspace-id>/v1",
api_key=os.environ["SENTISEC_API_KEY"],
)
resp = client.chat.completions.create(
model="gemini-3.6-flash",
messages=[{"role": "user", "content": "hi"}],
)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.sentisec.ch/ws/<your-workspace-id>/v1",
apiKey: process.env.SENTISEC_API_KEY!,
});
const resp = await client.chat.completions.create({
model: "gemini-3.6-flash",
messages: [{ role: "user", content: "hi" }],
});Streaming ("stream": true) and OpenAI-format tool calling both work,
and tool calls are gated the same way they are on every other provider.
Model ids
| Model id | Notes |
|---|---|
gemini-3.6-flash | Fast general-purpose; the usual default. |
gemini-2.5-flash-image | Image-capable. |
gemini-3-pro-image-preview | Preview image model. |
gemini-embedding-001 | Embeddings — see below. |
Any id starting with gemini- is forwarded to Google, which is the
source of truth for what is available to your key. The table above is
what appears in model discovery
(GET .../v1/models); ids outside it still dispatch.
Embeddings
Gemini is one of the two providers that serve
POST .../v1/embeddings through Sentisec:
curl -X POST https://api.sentisec.ch/ws/<your-workspace-id>/v1/embeddings \
-H "Authorization: Bearer $SENTISEC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gemini-embedding-001", "input": "hello"}'Embeddings relay verbatim and are recorded for usage; there is no tool call in an embedding to gate.
If something goes wrong
| Response | What it means |
|---|---|
401 / 402 no_upstream_credential | No Gemini key is stored on this workspace. Add it under Settings → Providers, in Provider keys — the request's row under Requests offers Add Gemini key, which opens that page with Gemini selected. |
A Google 400 API_KEY_INVALID | The key was revoked or mistyped at AI Studio. Re-paste it. |
| Request went to a different provider | Your model id does not start with gemini-. Either use a gemini- id or send X-Sentisec-Upstream-Provider: gemini. |
More: Provider unavailable.
See also
- Google Vertex AI — the GCP-resident route
- Providers — every provider Sentisec carries
- Keys management — how credentials are stored