AnyRouteAnyRoute Docs
AnyRouteAnyRoute Docs
Homepage

Start Here

AnyRoute Documentation

Tools

Capabilities

API Reference

API ReferenceAuthenticationEndpoint Matrix
Gemini-compatible APIModelsGenerate ContentStream Generate ContentCount Tokens

Operations

FAQ
API ReferenceGemini

Stream Generate Content

Gemini native streaming endpoint.

Use POST /v1beta/models/{model}:streamGenerateContent?alt=sse for Gemini native streaming.

curl "https://anyroute.io/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse" \
  -H "Authorization: Bearer YOUR_ANYROUTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"role": "user", "parts": [{"text": "Stream a short answer."}]}]
  }'

Use this endpoint with Gemini SDKs or tools that speak Gemini native SSE.

Generate Content

Gemini native generateContent endpoint.

Count Tokens

Gemini native countTokens endpoint.