Gemini chat API

Text, image understanding, streaming responses, and function calling with Gemini.

Gemini chat API

Use an Official Group API key with POST https://app.apipool.dev/v1/chat/completions.

curl https://app.apipool.dev/v1/chat/completions \
  -H "Authorization: Bearer $APIPOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gemini-3.8-flash","messages":[{"role":"user","content":"Explain photosynthesis in one sentence."}],"max_tokens":128,"stream":false}'

Models

See each model page for current availability, pricing, and the text playground.

Model IDModel page
gemini-3-flash-previewModel page
gemini-3-flash-preview-thinkingModel page
gemini-3-flash-preview-nothinkingModel page
gemini-3.1-flash-lite-previewModel page
gemini-3.1-pro-previewModel page
gemini-3.1-pro-preview-thinkingModel page
gemini-3.5-flash-liteModel page
gemini-3.6-flashModel page
gemini-3.8-flashModel page
gemini-4-argonModel page

Parameters and capabilities

  • messages is a nonempty array. It supports text and image_url content blocks. Image inputs count toward usage.
  • Set stream: true for SSE. Read through the final usage event and [DONE] marker.
  • Use type: "function" with tools and specify a function with tool_choice when needed. Your application executes returned tool_calls and sends each result as a tool message. Function schema property names may include words that also appear in prompts.
  • Provide either max_tokens or max_completion_tokens. The maximum is 65,536 for most models and 16,000 for Argon. The remaining context window may reduce available output. Each request supports n=1.
  • Built-in search, explicit cache creation, audio, video, PDF input, and extra_body passthrough are currently unavailable.

Pricing and limits

Billing uses actual input, cached input, and output tokens. Output usage includes reasoning tokens. Gemini 3.1 Pro requests with more than 200,000 input tokens use the long-context rate listed on the model page. When a separate cache rate is unavailable, cached input uses the input rate.

The current Gemini 3.8 Flash promotion runs through December 31, 2026. The Argon promotion runs through November 30, 2026. Each request uses the pricing version active at submission.

After a stream disconnects, check the request log for recorded usage. If a response or parameter differs from expectations, shorten the request and verify the exact model ID.

Gemini 3.6 Flash

Use gemini-3.6-flash with an Official Group key. It supports text, image understanding, streaming, and function calling. Limits are 1,048,576 input tokens and 65,536 output tokens.

Current prices per million tokens are US$1.275 for input, US$0.1275 for cached input, and US$6.375 for output. The request's pricing version determines the final charge.

The model page includes a text playground. Use the API for image understanding and function calling.