RelayRouterRelayRouter
HomeModelsPricingDocsGuides
Get API Key →

Protocols

Gemini-compatible API

Gemini clients call /v1beta/models/{model}:generateContent. RelayRouter serves that path on its own domain, so the Google GenAI SDK, Gemini CLI and hand-written HTTP calls work after you change the base URL and the key. Streaming uses streamGenerateContent exactly as with Google.

Base URL and endpoints

https://relayrouter.io The SDK appends /v1beta itself; for raw HTTP use https://relayrouter.io/v1beta/models/{model}:generateContent.

MethodPathNotes
POST/v1beta/models/{model}:generateContentSingle response
POST/v1beta/models/{model}:streamGenerateContentStreaming, add ?alt=sse for server-sent events
GET/v1/modelsThe models your key can call

Authentication: x-goog-api-key: <your RelayRouter key>, or the key query parameter, as with Google.

Code

Python

main.pypython
from google import genai
from google.genai import types

client = genai.Client(
    api_key="your-relayrouter-key",
    http_options=types.HttpOptions(base_url="https://relayrouter.io"),
)

resp = client.models.generate_content(model="gemini-3.8-flash", contents="Hello!")
print(resp.text)

cURL

terminalbash
curl "https://relayrouter.io/v1beta/models/gemini-3.8-flash:generateContent" \
  -H "x-goog-api-key: $RELAYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents": [{"parts": [{"text": "Hello!"}]}]}'

Gemini CLI

terminalbash
export GOOGLE_GEMINI_BASE_URL="https://relayrouter.io"
export GEMINI_API_KEY="your-relayrouter-key"
gemini

Groups that speak this protocol

A key belongs to one group. Create it in the console for one of the groups below; the models page has every group and model with live rates.

GroupRateModels (examples)
Gemini Fast¥2.72 per $1 of standard usage, about 60% below the ¥6.8/$ referencegemini-2.5-flash, gemini-3-flash, gemini-3-flash-preview, gemini-3.1-flash-lite, gemini-3.1-flash-lite-preview and 4 more
Gemini Vertex Official¥5.4 per $1 of standard usage, about 21% below the ¥6.8/$ referencegemini-2.0-flash, gemini-2.5-computer-use-preview-10-2025, gemini-2.5-flash, gemini-2.5-flash-image, gemini-2.5-flash-image-preview and 25 more

Tools that work as-is

Questions

Which Gemini models are available?

gemini-3.8-flash, gemini-3.7-flash and the other models listed in the Gemini groups on the models page. Each group has its own rate.

Can I call Gemini models through the OpenAI-compatible endpoint instead?

Use the protocol of the group your key belongs to. Gemini groups speak the Gemini API; if your tool only speaks OpenAI, pick an OpenAI-protocol group from the models page.

Does streaming work?

Yes, through streamGenerateContent with ?alt=sse, the same as against Google.

How is it billed?

Per token at the group's rate from a prepaid balance, with no platform fee; failed requests are not billed.