Available on Bilibili, YouTube, Douyin, and WeChat Official Account under the same name. Please credit the author when reposting.
Demo: https://play.210718.xyz
Deploy a Gemini multimodal chat website in 10 seconds with just a Gemini API Key. Accessible from any region/network environment, ready to use immediately. Free serverless deployment using Deno/Cloudflare Worker. Converts Gemini Chat API to the more universal OpenAI format, accessible directly within China. Compatible with AI programming, can be integrated with ChatBox and other AI clients.
-
Fork this project
-
Login/Register at https://dash.deno.com/
-
Create a project at https://dash.deno.com/new_project
-
Select this project, enter project name (please choose carefully as it affects the auto-assigned domain)
-
Set Entrypoint to
src/deno_index.ts
, leave other fields empty -
Click Deploy Project
-
After successful deployment, you'll get a domain name. The site is ready to use, and the domain can also be used as a Chat API proxy.
-
Click the deploy button
-
Login to your Cloudflare account
-
Enter Account ID and API Token
-
Fork this project, enable Github Action
-
Deploy, open dash.cloudflare.com to view the deployed worker
-
For use in China, a custom domain name needs to be bound
When using Cloudflare in China, you might encounter "400: User location is not supported for the API use." This might be due to Cloudflare routing to Hong Kong CDN nodes in the Guangdong-Hong Kong region. Recommend switching to Deno deployment.
Install Deno on Windows:
irm https://deno.land/install.ps1 | iex
Install Deno on Mac/Linux:
curl -fsSL https://deno.land/install.sh | sh
Start the project:
cd project_directory
deno run --allow-net --allow-read src/deno_index.ts
Enter API Key, click Connect button to start chatting. The three buttons are for:
- Enable microphone
- Enable camera
- Share screen
![image](/docs/images/2.png)
The API has been proxied to OpenAI format and can be used directly with OpenAI format API. Remember to replace the domain and Gemini API Key.
Available models:
curl --location 'http://your.domain.com/v1/models' \
--header 'Authorization: Bearer YOUR-GEMINI-API-KEY'
Chat:
curl --location 'https://your.domain.com/v1/chat/completions' \
--header 'Authorization: Bearer YOUR-GEMINI-API-KEY' \
--header 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "system",
"content": "You are a test assistant."
},
{
"role": "user",
"content": "Testing. Just say hi and nothing else."
}
],
"model": "gemini-2.0-flash-exp"
}'
Website UI:
Author: ChrisKyle
Project: https://github.com/ViaAnthroposBenevolentia/gemini-2-live-api-demo
MIT License : https://github.com/ViaAnthroposBenevolentia/gemini-2-live-api-demo/blob/main/LICENSE
Gemini to OpenAI format conversion:
Author: PublicAffairs
Project: https://github.com/PublicAffairs/openai-gemini
MIT License : https://github.com/PublicAffairs/openai-gemini/blob/main/LICENSE