Gemini protocol
Send content using the Gemini generateContent format.
Service address
This page covers native Gemini REST model discovery, content generation, streaming, and embeddings. Use the Gemini native image guide for image-specific parameters.
Models and discovery
| Purpose | Method | Path |
|---|---|---|
| Gemini model list | GET | /v1beta/models |
| Gemini compatible model list | GET | /v1/models |
Content generation
| Purpose | Method | Path |
|---|---|---|
| generateContent | POST | /v1beta/models/{model}:generateContent |
| streamGenerateContent | POST | /v1beta/models/{model}:streamGenerateContent |
Embeddings
| Purpose | Method | Path |
|---|---|---|
| embedContent | POST | /v1beta/models/{model}:embedContent |
| batchEmbedContents | POST | /v1beta/models/{model}:batchEmbedContents |
| Gemini compatible embeddings | POST | /v1/engines/{model}/embeddings |
Minimal request
Replace YOUR_MODEL with the actual model ID and keep it in the URL path. Prefer x-goog-api-key: YOUR_API_KEY; the gateway also accepts Bearer. Use the key query parameter only when a client explicitly requires it, because URLs can be logged.
curl "https://api.popgo.site/v1beta/models/YOUR_MODEL:generateContent" \
-H "x-goog-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{"parts": [{"text": "Reply with a connection confirmation"}]}
]
}'
Verify
A successful response contains candidate content or embeddings. Use streamGenerateContent for streaming; choose embedContent, batchEmbedContents, or the compatible embedding path for embeddings. For a 404, check the model ID, protocol path, and Key group.