Crazyrouter API Document
🇺🇸 English
  • 中文
  • 🇺🇸 English
🇺🇸 English
  • 中文
  • 🇺🇸 English
🇺🇸 English
  • 中文
  • 🇺🇸 English
API 参考
快速开始接入教程官网模型与价格控制台
API 参考
快速开始接入教程官网模型与价格控制台
  1. Plugins & Client Setup Guides
  • 默认模块
    • Crazyrouter Overview
      • Introduction
      • API request
      • API Quick Start Guide
      • API Endpoint
      • Contact us
    • Chat
      • ChatGPT
        • ChatGPT Audio
          • whisper-1
          • Create Translation (whisper-1, audio to English, untested)
        • ChatGPT Chat
          • Chat Completion Object
          • Chat Completion Chunk Object
          • Create Chat Completion (Streaming)
          • Create Chat Completion (Non-Streaming)
          • Create Chat Vision (Streaming)
          • Create Chat Vision (Streaming) base64
          • Create Chat Vision (Non-Streaming)
          • Create Chat Image Generation (Non-Streaming)
          • Function calling
          • Official N Test
          • Create Chat Function Call
          • Create Structured Output
          • Control Reasoning Model Effort Level
          • Create Chat Completion qwen-mt-turbo
          • Create Chat Completion DeepSeek V3.1 Thinking Level (Streaming)
          • DeepSeek OCR Recognition
        • ChatGPT Completions
          • Completion Object
        • ChatGPT Embeddings
          • Embedding Object
          • Create Embedding
        • Web Search
          • web search
        • ChatGPT Moderations
          • Content Moderation (Moderations)
      • Anthropic Claude
        • Chat Completion Object
        • Chat Completion Chunk Object
        • Count Input Tokens count_tokens [Native Format]
        • Create Chat Completion (Streaming) [Native Format]
        • Create Function Call (Streaming) [Native Format]
        • Create Thinking Chat [Native Format]
        • Create Thinking Chat
        • Create Chat Completion (Streaming)
        • Create Chat Completion (Non-Streaming)
        • Create Chat Vision (Streaming)
        • Create Chat Vision (Non-Streaming)
        • PDF Support [Native Format]
      • Google Gemini
        • Gemini Native Format
          • Create Context Cache cachedContents [Native Format]
          • Text Generation
          • Text Generation Streaming
          • Text Generation Thingking+streaming
          • Image Generation gemini-2.5-flash-image
          • Image Generation gemini-2.5-flash-image Control Aspect Ratio +imageSize
          • Image Understanding
          • Formatted Output
          • Function Call
          • Document Understanding
          • URL context
          • Code Execution
          • Video Understanding
          • URL context
          • Video Understanding-url Native Format
          • Audio Understanding
          • Text Generation gemini-3-pro-preview:generateContent
        • Chat-compatible Format
          • Gemini Image Generation API [Chat Compatible Format]
          • Chat API [Chat Compatible Format]
          • Chat API - Thinking 1 [Chat Compatible Format]
          • Chat API - Thinking 2 [Chat Compatible Format]
          • Vision API [Chat Compatible Format]
          • Chat + File Reading API [Chat Compatible Format]
    • Chat (Responses)
      • Responses API vs Chat API
      • Create Function Calling
      • Create Model Response (Streaming)
      • Create Model Response (Control Thinking Length)
      • web search
      • Create Model Response (GPT-5 Enable Thinking)
    • Image Generation Models
      • Image Object
      • Midjourney
        • Submit Video Task (Image-to-Video)
        • Submit Simple Change Task (String Form)
        • Get Task Image (Gateway-Hosted Copy)
        • Submit Edits Task (Inpainting)
        • Submit Shorten Task (Prompt Shortening)
        • Submit Change Task (U/V/R Actions)
        • InsightFace Face Swap
        • upload image
        • upload Imagine task
        • Query Task Status by Task ID
        • Query Tasks by ID List
        • Get Task Image Seed
        • Execute Action
        • Submit Blend Task
        • Sumit Describe task
        • Sumit Modal
      • GPT Image (gpt-image-2)
        • Create gpt-image-1
        • Create Image (gpt-image-2, OpenAI images/generations format)
        • Edit Image (gpt-image-2, mask / multi-image reference)
      • Jimeng Image
        • Create Image
        • Edit Image
      • Doubao Seedream
        • doubao-seedream-3-0-t2i-250415
        • doubao-seededit-3-0-i2i-250628
        • doubao-seedream-4-0-250828 Text-to-Image
        • doubao-seedream-4-0-250828 Image-to-Image
        • doubao-seedream-4-0-250828 Multi-Image to Image
        • doubao-seedream-4-5-251128 Text-to-Image (text-only input, single image output)
        • doubao-seedream-4-5-251128 Text+Image to Image (single image in, single image out)
        • doubao-seedream-4-5-251128 Multi-Image Fusion (multiple inputs, single output)
        • doubao-seedream-4-5-251128 Image Set Output (multi-image output)
        • doubao-seedream-4-5-251128 Single Image to Image Set
        • doubao-seedream-4-5-251128 Multi-Reference to Image Set
      • Qwen-Image
        • qwen-image-edit-2509
    • Video Models
      • Veo
        • Unified Video Format
          • Unified Video API Task Status
          • Create Video with Image
          • Create Video (Reference Image)
        • OpenAI Video Format
      • Kling
        • Callback Protocol
        • Omni Video omni-video (kling-v3-omni / kling-video-o1)
        • Image Generation
        • Text-to-Video
        • Image to Video
        • Query Task (free)
        • Multi-Image Reference to Video
        • Lip Sync
        • Extend Video
        • Video Effects
      • Jimeng Video
        • Jimeng Task Status
        • Submit Video Generation Task
        • Query Video Task (free)
      • Hailuo (MiniMax)
        • Hailuo Task Status
        • Submit Video Generation Task
        • Query Video Task Status
        • Image-to-Video
      • Doubao Seedance
        • Text-to-Video Example
        • Image to Video - First Frame
        • seedance-lite First/Last Frame
        • Image-to-Video (base64 encoded)
        • Query Single Task
      • Sora
        • OpenAI Video Format
          • OpenAI Query Task
          • OpenAI Download Video
          • OpenAI Create Video (with image)
          • Create Video from Storyboard
          • OpenAI Create Video with Image (Private Mode)
          • OpenAI Create Video (with Character)
      • Tongyi Wanxiang
        • Generate Video
        • Query Video
      • Unified Video API (all video models)
        • Query Video Task (Unified Format)
        • Submit Video Generation Task (Unified Format)
    • System API
      • List Tokens
      • Create Token
      • Get Models Supported by Token
      • Get Account Info
      • Update Token
      • Delete Token
      • Search Tokens
      • Query Async Task (Image / Video)
      • Get Single Model Info
    • Suno Music
      • Suno Parameters
      • Suno Overview
      • Submit Tasks
        • Generate Song (Inspiration Mode)
        • Generate Song (Custom Mode)
        • Generate Song (Extend Mode)
        • Generate Song (Artist Style)
        • Generate Song (Upload Song for Re-creation)
        • Generate Lyrics
        • Concatenate Songs
      • Query Tasks
        • Batch Get Tasks
        • Query Single Task
        • Get WAV
    • Python
      • Python Speech-to-Text (whisper-1)
      • Python Embeddings
      • Python Function Calling Demo
      • Python LangChain Demo
      • Python llama_index Configuration
      • Python Basic Chat
      • Python Local Image Recognition (Multimodal)
      • Python Remote Image Recognition (Multimodal)
      • Python Image Recognition with Claude
      • Python Library Streaming Output
      • Python requests streaming output demo
      • Python image generation and editing (gpt-image-2)
      • Python official OpenAI library (AutoGPT / LangChain, etc.)
      • Python multi-turn conversation
    • Rerank
      • Rerank
    • PHP
      • PHP Image Editing Demo
    • Node.js
      • Node.js Audio Transcription Demo
    • Plugins & Client Setup Guides
      • Codex
      • N8N
      • Gemini CLI
      • Claude Code Installation and Usage Guide
      • CherryStudio Configuration Guide
      • dify Configuration Guide
      • cline
      • aider
      • Cursor
      • lobechat
      • ChatBox
      • gpt_academic
      • nextchat
      • zotero gpt
      • CLAUDE DEV
      • ChatGPT Sidebar
      • chatgpt-on-wechat
      • chatgpt GPT Academic
      • RikkaHub
      • Coze Workflow Configuration Guide
    • Help Center
      • Thinking Model Response Format
      • HTTP Status Codes and Their Meanings
      • Image Upload API
    • Decisions API (TypeSafe JEV)
      • Create Decisions
    • 3D Generation (Hunyuan hy-3d)
      • Query 3D Generation Task
      • Submit 3D Generation Task
    • File Upload
      • Temporary Images
        • Temporary Base64 Image Upload
        • Get Presigned Direct Upload URL (recommended for large files)
        • Re-host Remote Image as Temporary URL
        • Temporary Local Image Upload
      • Playground
        • Playground Image Upload
      • Deprecated
        • Legacy Upload Endpoint (Unsupported)
  • Unified Video API
    • Unified Video
  1. Plugins & Client Setup Guides

Gemini CLI

Gemini CLI User Guide#

Introduction#

Gemini CLI is an open-source command-line AI tool provided by Google that brings the power of Gemini directly to your terminal. It offers a lightweight way to access Gemini, providing the most direct path from prompt to model. By configuring a proxy, you can use Gemini CLI services even in network-restricted environments.

🚀 Why Choose Gemini CLI?#

🧠 Powerful Gemini 2.5 Pro: Access to 1 million token context window
🔧 Built-in Tools: Google Search grounding, file operations, Shell commands, web scraping
🔌 Extensible: Supports MCP (Model Context Protocol) for custom integrations
💻 Terminal-First: Designed for developers who work in the command line
🛡️ Open Source: Apache 2.0 License

📦 Installation#

Quick Install#

Run Instantly with npx (No Installation Required)#

Global Installation with npm#

Install with Homebrew (macOS/Linux)#

System Requirements#

Node.js version 20 or higher
macOS, Linux, or Windows

Configuring the Proxy#

1. Set Environment Variables#

Before using the proxy, you need to configure the following environment variables:
Note: You can also add these environment variables to your .bashrc, .zshrc, or other shell configuration files so they are automatically set each time you start the terminal.

🚀 Quick Start#

Basic Usage#

Start in Current Directory#

Include Multiple Directories#

Use a Specific Model#

Non-Interactive Script Mode#

Get a simple text response:
Get structured JSON output:

Quick Examples#

Start a New Project#

Analyze Existing Code#

📋 Main Features#

Code Understanding and Generation#

Query and edit large codebases
Generate new applications from PDFs, images, or sketches using multimodal capabilities
Debug issues and troubleshoot using natural language

Automation and Integration#

Automate operational tasks like querying pull requests or handling complex rebases
Connect new capabilities using MCP servers
Run non-interactively in scripts for workflow automation

Advanced Features#

Get real-time information using built-in Google Search
Conversation checkpoints to save and restore complex sessions
Custom context files (GEMINI.md) to tailor behavior for your project

Common Commands and Examples#

Explore Codebase#

> Describe the main components of this system architecture
> What security mechanisms are in place?
> Provide a step-by-step onboarding document for new developers

Work with Existing Code#

> Implement a first draft for GitHub issue #123
> Help me migrate this codebase to the latest version of Java. Start with a plan

Automate Workflows#

> Create a slideshow showing the git history from the past 7 days, grouped by feature and team member
> Create a full-screen web app for wall display showing our most interactive GitHub issues

System Interaction#

> Convert all images in this directory to png and rename them using the date from exif data
> Organize my PDF invoices by spending month

GitHub Integration#

Use the Gemini CLI GitHub Action to integrate Gemini CLI directly into your GitHub workflows:
Pull Request Reviews: Automated code reviews with contextual feedback and suggestions
Issue Triage: Automatically label and prioritize GitHub issues based on content analysis
On-Demand Help: Mention @gemini-cli in issues and pull requests for help with debugging, explanations, or task delegation
Custom Workflows: Build automated, scheduled, and on-demand workflows tailored to your team's needs

Troubleshooting#

If you encounter issues during use, consider the following:
1.
Check if environment variables are set correctly:
2.
Check if network connection is stable and proxy is accessible:
3.
Check for error message output, which usually indicates the problem
4.
If using SOCKS proxy, ensure the proxy format is correct, e.g., socks5://<user>:<pass>@<proxy>:<port>
5.
Use built-in command to report issues:

Release Notes#

Preview#

New preview versions are released every Tuesday at UTC 23:59. Install using the preview tag:

Stable#

New stable versions are released every Tuesday at UTC 20:00. Install using the latest tag:

Nightly#

Nightly versions are released every day at UTC 00:00. Install using the nightly tag:

MCP Server Usage#

Configure MCP servers in ~/.gemini/settings.json to extend Gemini CLI with custom tools:
> @github list my open pull requests
> @slack send a summary of today's commits to #dev channel
> @database run a query to find inactive users

📚 Related Resources#

Official Roadmap: View upcoming features
NPM Package: Package registry
GitHub Issues: Report bugs or request features
Security Advisories: Security updates

Uninstall#

If you need to uninstall Gemini CLI, please refer to the official uninstall guide.
Modified at 2026-09-28 09:50:55
Previous
N8N
Next
Claude Code Installation and Usage Guide
Built with