iBUHub/AIStudioToAPI

A wrapper that exposes Google AI Studio Build as OpenAI, Gemini, and Anthropic compatible APIs.(一个将 Google AI Studio Build 封装为兼容 OpenAI / Gemini / Anthropic 风格 API 的工具)

What it solves

AIStudioToAPI lets you use Google AI Studio Build apps through standard, developer-friendly APIs. Normally, AI Studio Build apps are only accessible through a web interface, which makes them hard to call from code. This project wraps that web interface and exposes it as OpenAI-, Gemini-, and Anthropic-compatible API endpoints, so you can send normal API requests and get responses back without manually driving a browser.

How it works

The service runs as a proxy. It receives API requests in OpenAI, Gemini, or Anthropic formats, then uses browser automation (specifically Camoufox, a privacy-focused Firefox fork) to interact with the AI Studio Build App web interface. It converts the API request into the appropriate browser actions, retrieves the result, and sends it back in the expected API format. It supports multiple Google accounts, which can be added via a setup script or, in Docker, through a VNC-based login page. A web console provides account management, status monitoring, and usage statistics. The service is configurable through environment variables and a models configuration file.

Who it’s for

Developers who want to programmatically access Google AI Studio Build apps using standard API conventions. It’s especially useful if you need multi-account support, tool/function calling, image generation, or text-to-speech, and you want to plug into existing tools that expect OpenAI, Gemini, or Anthropic APIs. It also suits users who prefer a Docker deployment with a visual console for managing accounts.

Highlights

  • Compatible with OpenAI, Gemini, and Anthropic API formats
  • Uses browser automation to interact with AI Studio Build apps
  • Supports multiple Google accounts with quick switching
  • Tool calls (function calling) supported across all three API formats
  • Access to various Gemini models, including image generation and TTS
  • Web console for account management, VNC login, and usage stats
  • Deployable via Docker or directly on Windows/macOS/Linux
  • Configurable via environment variables (API keys, proxies, streaming modes, etc.)
  • Fork of ais2api, licensed under CC BY-NC 4.0

Related

  • Project
  • Project
  • Project
  • Project
  • Project