dakl45646 commited on
Commit
9634bf9
·
verified ·
1 Parent(s): 85f025a

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -4
README.md CHANGED
@@ -1,10 +1,35 @@
1
  ---
2
- title: Cs
3
- emoji: 💻
4
- colorFrom: purple
5
  colorTo: purple
6
  sdk: docker
 
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: AI Studio Proxy API
3
+ emoji: 🚀
4
+ colorFrom: blue
5
  colorTo: purple
6
  sdk: docker
7
+ app_port: 7860
8
  pinned: false
9
+ short_description: 将Google AI Studio转换为OpenAI兼容API
10
+ license: mit
11
  ---
12
 
13
+ # AI Studio Proxy API
14
+
15
+ 基于Python的代理服务器,将Google AI Studio网页界面转换为OpenAI兼容的API。
16
+
17
+ ## 快速开始
18
+
19
+ ### API访问
20
+ - **基础URL**: `https://your-username-ai-studio-proxy.hf.space/v1`
21
+ - **聊天端点**: `POST /v1/chat/completions`
22
+ - **Web UI**: `https://your-username-ai-studio-proxy.hf.space`
23
+
24
+ ### 示例请求
25
+ ```python
26
+ import openai
27
+
28
+ openai.api_base = "https://your-username-ai-studio-proxy.hf.space/v1"
29
+ openai.api_key = "sk-anykey"
30
+
31
+ response = openai.ChatCompletion.create(
32
+ model="gemini-pro",
33
+ messages=[{"role": "user", "content": "Hello!"}]
34
+ )
35
+ print(response.choices[0].message.content)