Introduction
Gemini CLI is Google’s official command-line tool that lets developers interact with Gemini AI models from the terminal. After configuring OneAster API, you can use OneAster’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) -
OneAster API key
Sign in to the OneAster Console and copy your API key (starts withsk-)
Tip: If you don’t have an OneAster account yet, register at OneAster 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 OneAster 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 OneAster Console - Set GEMINI_BASE_URL to https://api.oneaster.ai/v1 so Gemini CLI talks to OneAster - 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 OneAster from your code
4.1 Python SDK
4.2 JavaScript / TypeScript
4.3 cURL
Step 5: Pick a model
Recommended models
OneAster supports many models; choose by task and budget. Gemini
GPT
Claude
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 OneAster 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 OneAster:- ✅ 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 OneAster Console:- 📊 Live call stats
- 💰 Cost and invoices
- 📈 Usage trends
- 🔍 Request logs
- ⚙️ API key management
Q5: Common API errors
Best practices
1. Retries and backoff
2. Cost control
3. System prompts
Features
With Google AI Studio and OneAster 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
- 📚 OneAster documentation
- 📚 Google AI Studio documentation
- 💬 Discord
- 🐦 Twitter @oneaster_
- 📧 [email protected]
Get started with OneAster
Create an account, grab an API key, and use multiple AI models from Google AI Studio workflows and beyond.