Aiflow

Gemini

Call Gemini models through Aiflow with the OpenAI-compatible endpoints.

Aiflow serves Gemini through Antigravity. You call it with the same OpenAI-compatible API and sk-... key as every other model. Aiflow converts the request to Gemini's format and converts the answer back, so you don't need a Google SDK or a Google API key.

Models

Model IDModel
ag/gemini-pro-agentGemini 3.1 Pro
ag/gemini-3.6-flash-highGemini 3.6 Flash
ag/gemini-3.7-flash-highGemini 3.7 Flash
ag/gemini-3.8-flash-highGemini 3.8 Flash

Every ag/ model appears in /v1/models. Older antigravity-gemini-... IDs still work for existing clients.

Endpoints

Gemini models work on two endpoints:

MethodPath
POST/v1/chat/completions
POST/v1/responses

They are not available on /v1/messages, and Aiflow has no native Gemini generateContent endpoint.

Chat Completions

curl https://api.tryaiflow.io/v1/chat/completions \
  -H "Authorization: Bearer $AIFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "ag/gemini-3.8-flash-high",
    "messages": [
      { "role": "system", "content": "Answer in one sentence." },
      { "role": "user", "content": "What is a mutex?" }
    ]
  }'

Responses

curl https://api.tryaiflow.io/v1/responses \
  -H "Authorization: Bearer $AIFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "ag/gemini-pro-agent",
    "instructions": "Answer in one sentence.",
    "input": "What is a mutex?"
  }'

OpenAI SDK

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env.AIFLOW_API_KEY,
  baseURL: 'https://api.tryaiflow.io/v1',
});

const completion = await client.chat.completions.create({
  model: 'ag/gemini-3.8-flash-high',
  messages: [{ role: 'user', content: 'Reply with ok' }],
});

console.log(completion.choices[0].message.content);

Supported input

FeatureChat CompletionsResponses
Textsystem, developer, user, assistantinstructions and input messages
Imagesimage_url as a base64 data URLinput_image as a base64 data URL
Function toolstools with type: "function"tools with type: "function"
Tool resultstool messagesfunction_call_output items
Output limitmax_tokens or max_completion_tokensmax_output_tokens
TemperaturetemperatureNot forwarded

Limits

  • Function tools only. Built-in tools such as web search and file search are rejected.
  • No previous_response_id. Send the full conversation in input on each request.
  • Buffered streaming. stream: true returns valid SSE, but the events arrive together after Gemini finishes the answer. Tokens are not streamed one by one.
  • Account-enabled keys only. A key that is limited to upstream routing gets 403. Contact support if you need Gemini access on your key.

Gemini usage counts against the same key budget as other models. Check it with the Usage API.