Documentation Index
Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Gemini CLI is Google’s official command-line tool that lets developers interact with Gemini AI models from the terminal. After configuring APIMart API, you can use APIMart’s advanced models—GPT, Claude, and Gemini—in Gemini CLI.Prerequisites
Before you start:-
Node.js and npm installed
Download and install from the Node.js website (v16 or higher recommended) -
APIMart API key
Sign in to the APIMart Console and copy your API key (starts withsk-)
Tip: If you don’t have an APIMart account yet, register at APIMart first and create an API key.
Step 1: Install Gemini CLI
1.1 Global install
Install Gemini CLI globally with npm:1.2 Verify installation
Check that the CLI is available:Tip: If the command is not found, restart your terminal or check your npm global
PATH configuration.Step 2: Configure APIMart API
2.1 Temporary environment variables
For testing or one-off use; values are cleared when you close the terminal. Windows (PowerShell):2.2 Permanent environment variables (recommended)
Persist configuration so new shells pick it up automatically. Windows (PowerShell):- Run PowerShell as Administrator
- Set user-level environment variables:
- Restart PowerShell, or reload variables:
- Edit your shell rc file:
- Append:
- Reload:
2.3 Using a .env file
Create .env in your project:
Important: - Replace
sk-xxxxxxxxxxxx with your real key from the APIMart Console - Set GEMINI_BASE_URL to https://api.apimart.ai/v1 so Gemini CLI talks to APIMart - Add .env to .gitignore so keys are not committed2.4 Verify configuration
macOS/Linux:Step 3: Use Gemini CLI
3.1 Basic chat
Interactive session:3.2 Choose a model
3.3 Read prompts from a file
3.4 Save output to a file
Step 4: Call APIMart from your code
4.1 Python SDK
4.2 JavaScript / TypeScript
4.3 cURL
Step 5: Pick a model
Recommended models
APIMart supports many models; choose by task and budget. Gemini| Model name | Model ID | Characteristics | Good for |
|---|---|---|---|
| Gemini 2.0 Flash | gemini-2.0-flash-exp | Fast, multimodal | Quick answers, vision + text |
| Gemini 2.5 Pro | gemini-2.5-pro | Strong capability | Hard problems, analysis |
| Gemini 2.5 Flash | gemini-2.5-flash | Very responsive | Real-time chat, batch jobs |
| Model name | Model ID | Characteristics | Good for |
|---|---|---|---|
| GPT-5 | gpt-5 | Top-tier | Reasoning, creative writing |
| GPT-4o | gpt-4o | High quality | General chat, content |
| GPT-4o Mini | gpt-4o-mini | Cost-efficient | Simple tasks, high volume |
| Model name | Model ID | Characteristics | Good for |
|---|---|---|---|
| Claude Sonnet 4.5 | claude-sonnet-4-5-20250929 | Strong reasoning | Code, logic |
| Claude Haiku 4.5 | claude-haiku-4-5-20251001 | Very fast | Q&A, low-latency chat |
Advanced features
Multimodal (images)
With a multimodal model such as Gemini 2.0 Flash:Streaming
Stream tokens as they arrive:Tuning parameters
Shape randomness and length:FAQ
Q1: “Invalid API key” or auth errors
-
Key format
- Must start with
sk- - No extra spaces when pasting
- Must start with
-
Environment variables
-
Key status
- Check the key in the APIMart Console
- Ensure your account has balance
Q2: How do I verify the API setup?
Q3: Which languages are supported?
Any language that can send HTTP requests works with APIMart:- ✅ Python — OpenAI SDK recommended
- ✅ JavaScript / TypeScript — Node or browser
- ✅ Java — HTTP client
- ✅ Go — stdlib or libraries
- ✅ PHP — cURL or Guzzle
- ✅ Ruby — HTTP gems
- ✅ C# / .NET —
HttpClient - ✅ Swift —
URLSession - ✅ Others — anything with HTTP
Q4: Where can I see usage and billing?
In the APIMart Console:- 📊 Live call stats
- 💰 Cost and invoices
- 📈 Usage trends
- 🔍 Request logs
- ⚙️ API key management
Q5: Common API errors
| Error | Likely cause | What to do |
|---|---|---|
401 Unauthorized | Bad or revoked key | Fix key in env / console |
429 Too Many Requests | Rate limit | Slow down or upgrade plan |
500 Internal Server Error | Transient server issue | Retry later; contact support if it persists |
insufficient_quota | Low balance | Top up in console |
Best practices
1. Retries and backoff
2. Cost control
3. System prompts
Features
With Google AI Studio and APIMart you get:- 🤖 Many models — GPT, Claude, Gemini, and more
- 🌍 OpenAI-compatible — familiar request / response shape
- ⚡ Performance — low latency, high concurrency
- 💰 Clear pricing — pay as you go
- 📊 Observability — monitor calls in real time
- 🔒 Security — enterprise-oriented safeguards
- 🚀 Fast integration — simple HTTP / SDK calls
- 📚 Docs — guides and examples
Support
- 📚 APIMart documentation
- 📚 Google AI Studio documentation
- 💬 Discord
- 🐦 Twitter @APIMart_
- 📧 zhihong@apimart.ai
Get started with APIMart
Create an account, grab an API key, and use multiple AI models from Google AI Studio workflows and beyond.