Skip to main content
AnyFast also provides Gemini models through the OpenAI-compatible /v1/chat/completions endpoint. Use the OpenAI SDK with Gemini model names — no Google SDK required.

Endpoint

POST https://www.anyfast.ai/v1/chat/completions

Authentication

Include your AnyFast API key as a Bearer token:
Authorization: Bearer YOUR_API_KEY

Quick example

curl https://www.anyfast.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-pro",
    "messages": [
      { "role": "user", "content": "Hello, Gemini!" }
    ]
  }'

Supported models

ModelDescription
gemini-3.1-pro-previewLatest Gemini 3.1 Pro
gemini-3.1-flash-image-previewGemini 3.1 Flash with image generation
gemini-3.1-flash-lite-previewGemini 3.1 Flash Lite
gemini-3-pro-previewGemini 3 Pro
gemini-3-pro-image-previewGemini 3 Pro with image generation
gemini-3-flash-previewGemini 3 Flash
gemini-2.5-proGemini 2.5 Pro
gemini-2.5-flashGemini 2.5 Flash
gemini-2.5-flash-liteGemini 2.5 Flash Lite
gemini-2.0-flashGemini 2.0 Flash

Features

  • Streaming — Set stream: true for real-time token streaming via SSE
  • JSON mode — Set response_format: { type: "json_object" }
  • Multi-turn conversations — Include full message history in messages
For advanced Gemini features like safety settings, structured output schemas, and function calling with Gemini-specific parameters, use the native format instead.