/v1/chat/completions endpoint. Use the OpenAI SDK with Gemini model names — no Google SDK required.
Endpoint
Authentication
Include your AnyFast API key as a Bearer token:Quick example
Supported models
| Model | Description |
|---|---|
| gemini-3.1-pro-preview | Latest Gemini 3.1 Pro |
| gemini-3.1-flash-image-preview | Gemini 3.1 Flash with image generation |
| gemini-3.1-flash-lite-preview | Gemini 3.1 Flash Lite |
| gemini-3-pro-preview | Gemini 3 Pro |
| gemini-3-pro-image-preview | Gemini 3 Pro with image generation |
| gemini-3-flash-preview | Gemini 3 Flash |
| gemini-2.5-pro | Gemini 2.5 Pro |
| gemini-2.5-flash | Gemini 2.5 Flash |
| gemini-2.5-flash-lite | Gemini 2.5 Flash Lite |
| gemini-2.0-flash | Gemini 2.0 Flash |
Features
- Streaming — Set
stream: truefor 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.