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 ID | Model page |
|---|---|
gemini-3-flash-preview | Model page |
gemini-3-flash-preview-thinking | Model page |
gemini-3-flash-preview-nothinking | Model page |
gemini-3.1-flash-lite-preview | Model page |
gemini-3.1-pro-preview | Model page |
gemini-3.1-pro-preview-thinking | Model page |
gemini-3.5-flash-lite | Model page |
gemini-3.6-flash | Model page |
gemini-3.8-flash | Model page |
gemini-4-argon | Model page |
Parameters and capabilities
messagesis a nonempty array. It supports text andimage_urlcontent blocks. Image inputs count toward usage.- Set
stream: truefor SSE. Read through the final usage event and[DONE]marker. - Use
type: "function"withtoolsand specify a function withtool_choicewhen needed. Your application executes returnedtool_callsand sends each result as a tool message. Function schema property names may include words that also appear in prompts. - Provide either
max_tokensormax_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 supportsn=1. - Built-in search, explicit cache creation, audio, video, PDF input, and
extra_bodypassthrough 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.