Gemini API
Google Multimodal AI Models
Access released Gemini models through OpenAI-compatible Chat Completions or native Gemini Generate Content. Supported inputs, reasoning, and streaming capabilities depend on the corresponding interface.
Why use Gemini through Ace Data Cloud?
Google's Gemini is one of the most advanced AI models available today. Gemini 3.8 Flash and some Gemini 4 models support long contexts and reasoning, making them suitable for code analysis, document processing, and multi-turn conversations. However, using the Google AI API directly requires addressing issues such as regional restrictions and billing configuration.
Existing OpenAI SDK projects can call Chat Completions. When using Google's native request and response formats, follow the Generate Content documentation for integration.
Core Capabilities of the Gemini API
Choose compatible or native interfaces based on your product needs. To generate or edit videos with Gemini Omni Flash, see Gemini Videos.
OpenAI-Compatible Format
Use Gemini through the /gemini/chat/completions endpoint, fully compatible with the OpenAI SDK. Switch seamlessly with zero code changes.
Deep Reasoning (Thinking)
Thinking tokens for Gemini 3.8 Flash and the Gemini 4 series count toward the output budget. Set max_tokens high enough for the answer based on the model.
Multimodal Input
Supports combined image + text input. Gemini can analyze images, read documents, and understand charts—native multimodal capabilities.
Million-Token Context
Gemini 3.8 Flash supports a context window of up to 100 ten-thousand-token units, easily handling long documents, code repositories, and complex conversations.
Streaming
Supports SSE streaming, returning generated content in real time. Set stream: true to receive an output stream token by token.
Structured Output
Use the response_format parameter to specify JSON output, and combine it with JSON Schema to obtain structured API responses.
from openai import OpenAI
client = OpenAI(
base_url="https://api.acedata.cloud/gemini",
api_key="YOUR_API_KEY",
)
response = client.chat.completions.create(
model="gemini-3.8-flash",
messages=[{"role": "user", "content": "用一句话解释量子计算"}],
max_tokens=1024,
)
print(response.choices[0].message.content)JSON Response
The following response is excerpted from the existing API guide and shows the fields used to read the result. The sample model, task ID, and media content come from that historical example; refer to the actual return values for this request.
{
"id": "chatcmpl-20251122212413908150493uPhjTUO9",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "I am a large language model, trained by Google."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 932,
"total_tokens": 940
}
}
The answer in a standard response is located at choices[0].message.content. For streaming responses and multimodal examples, see the API documentation.
Switch with one line of code in the OpenAI SDK
Simply change base_url and model to use Gemini in your existing OpenAI project—no code refactoring required.
Get an API Key
Log in to the application list, open General Application, and click the copy button to the right of API KEY. Keep the key on the server and use it to replace YOUR_API_KEY in the example.
Change base_url
Set base_url to https://api.acedata.cloud/gemini
Choose a Gemini model
Set model to a model supported by the current API, such as gemini-3.8-flash
What can you build with the Gemini API?
From intelligent conversations to complex reasoning—developers are building these applications with Gemini
AI Conversation Assistants
Build intelligent customer service, knowledge Q&A, or personal assistants using Gemini's powerful language understanding and multimodal capabilities
Coding Assistance
Generate, review, and debug code; choose Gemini 3.8 Flash or the Gemini 4 series based on the task
Document Analysis
Use a million-token context window to process long documents, analyze contracts, and generate reports
Scientific Research and Reasoning
Mathematical proofs, logical reasoning, scientific research—Gemini's Thinking mode provides deep reasoning capabilities
Get Started in 3 Steps
From signing up to sending your first Gemini message, it takes less than 3 minutes
Sign Up and Get an API Key
Follow the illustration above to copy the API Key for the general application.
Make Calls Using the OpenAI SDK
Set base_url to Ace Data Cloud and model to the Gemini model name.
Integrate and Extend
Embed Gemini in your application. Easily switch between models with the OpenAI-compatible format.
Why Choose Ace Data Cloud Over Using Google AI Directly?
Comprehensive advantages in format compatibility, global availability, and pricing
| Comparison | Ace Data Cloud | Direct Google AI Access |
|---|---|---|
| OpenAI-Compatible Format | ✓ | ✗ |
| Global Availability | ✓ Ready to use | ✗ Restricted in some regions |
| Rate Limits | Generous concurrency limits | ✗ Strict limits on the free tier |
| Streaming | ✓ | ✓ |
| Multimodal Input | ✓ | ✓ |
| Pay as You Go | ✓ Flexible top-ups | Monthly billing |
| Unified Interface with Other LLMs | ✓ GPT / Claude / Gemini | ✗ |
Choose the Right Gemini Model
From lightweight speed to top-tier reasoning, Gemini offers a range of model options
Gemini 3.5 Flash-Lite
Fast and Low-CostIdeal for batch classification, summarization, extraction, and simple Q&A.
- ✓ Entry-level cost
- ✓ Ideal for classification, extraction, and simple Q&A
- ✓ Multimodal support
Gemini 3.8 Flash
Best Balanced ChoiceThe best balance of speed and intelligence. Built-in Thinking reasoning mode, suitable for most production applications.
- ✓ Built-in deep reasoning
- ✓ Exceptional value
- ✓ Excellent coding and math performance
- ✓ 100 million Token context
Gemini 4 Argon
FlagshipA deep reasoning model for complex coding, analysis, and multi-step tasks. Accessible through the Chat Completions or Generate Content API.
- ✓ Industry-leading reasoning capabilities
- ✓ 100 million Token context
- ✓ Top-tier coding benchmark performance
- ✓ Deep analysis and complex tasks
Gemini API Pricing
Billing is based on the model and actual Token usage. See the pricing page for input, output, and applicable caching rates.
Get bigger discounts with bulk plans
Billed based on actual Token usage, with separate input and output pricing
- ✓ Flash series: exceptional value
- ✓ Pro series: flagship reasoning capabilities
- ✓ See the corresponding API documentation for models and features
- ✓ Deep reasoning Tokens at the same rate
- ✓ Streaming responses supported, billed by actual Token usage
Tailored solutions for high-volume teams
- ✓ Usage-based tiered discounts
- ✓ Priority support and an account manager
- ✓ Custom rate limits
- ✓ SLA guarantees
- ✓ Private deployment options
Frequently Asked Questions
Everything you need to know about using the Gemini API
How is this different from using the Google AI API directly? ▾
You can use the OpenAI SDK's Chat Completions interface or call Generate Content using the native Google Gemini format. Refer to the relevant API documentation for supported models, input types, and parameters.
Does it support the OpenAI SDK? ▾
Yes! Our Chat Completions API is fully compatible with the OpenAI SDK (Python, Node.js, Go, etc.). Simply change base_url to https://api.acedata.cloud/gemini and set model to the name of a Gemini model. Your existing OpenAI code requires almost no changes.
Which Gemini models are supported? ▾
Chat Completions offers Gemini 4 Carbon, Neon, Hydrogen, Argon, and Gemini 3.8 Flash, 3.5 Flash-Lite, and other models. Check the models and parameters for each API in the Chat Completions documentation and Generate Content documentation.
What is deep reasoning (Thinking)? ▾
Reasoning Gemini models consume thinking tokens before answering. For complex tasks with 3.8 Flash, set max_tokens above 512 and adjust it based on the output length. See the respective API documentation for Gemini 4 budget recommendations and parameters.
How does pricing work? ▾
See the pricing page for input, output, and cache rates for each model. Reasoning models' thinking tokens count toward the output budget.
Is multimodal input supported? ▾
Yes. Gemini natively supports multimodal input. You can include Base64-encoded images or image URLs in messages, and Gemini will understand the image content and use it alongside the text to respond. JPEG, PNG, GIF, and WebP formats are supported.
Can I use GPT, Claude, and Gemini at the same time? ▾
Yes! Ace Data Cloud provides multiple LLMs, including GPT, Claude, Gemini, and Kimi, through a unified OpenAI-compatible interface. Simply change the model parameter to switch between models. The API format is exactly the same, so there is no need to maintain multiple codebases.
Other AI Models
Explore our complete suite of AI APIs, covering large language models, images, video, music, and more
Claude API
Anthropic's full range of Claude models—powerful reasoning and conversation capabilities
Kimi API
Moonshot AI's Kimi K2 series—Chinese AI models with ultra-long context
Flux API
Black Forest Labs' top-tier text-to-image model
Suno API
AI music generation—create custom songs and instrumental music via API
Get Started with the Gemini API Now
Use Google's latest Gemini models in an OpenAI-compatible format. Pay as you go—no subscription fees, no commitments.
