MQK666 commited on
Commit
9bbe4e3
ยท
verified ยท
1 Parent(s): 1ef18ea

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +175 -0
README.md ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Oh My API
3
+ emoji: ๐Ÿพ
4
+ colorFrom: pink
5
+ colorTo: purple
6
+ sdk: docker
7
+ pinned: true
8
+ license: mit
9
+ ---
10
+
11
+ <div align="center">
12
+ <br/>
13
+
14
+ ```
15
+ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—
16
+ โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘
17
+ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘
18
+ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ• โ–ˆโ–ˆโ•‘
19
+ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ•โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘
20
+ โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•
21
+ ```
22
+
23
+ **็ปŸไธ€ AI API ไปฃ็†็ฝ‘ๅ…ณ**
24
+
25
+ [![Version](https://img.shields.io/badge/CLIProxyAPI-v6.8.37-0f172a?style=flat-square&labelColor=0f172a&color=38bdf8)](.)
26
+ [![SDK](https://img.shields.io/badge/SDK-Docker-0f172a?style=flat-square&labelColor=0f172a&color=6366f1)](.)
27
+ [![Status](https://img.shields.io/badge/Status-Running-0f172a?style=flat-square&labelColor=0f172a&color=22c55e)](.)
28
+ [![License](https://img.shields.io/badge/License-MIT-0f172a?style=flat-square&labelColor=0f172a&color=f59e0b)](.)
29
+
30
+ <br/>
31
+
32
+ > ไธ€ไธช่ฟ่กŒๅœจ HuggingFace Space ไธŠ็š„้ซ˜ๆ€ง่ƒฝ AI API ไปฃ็†๏ผŒ<br/>
33
+ > ็ปŸไธ€ๆŽฅๅ…ฅ Claude ยท Gemini ยท OpenAI ยท Codex ยท Vertex AI
34
+
35
+ <br/>
36
+
37
+ </div>
38
+
39
+ ---
40
+
41
+ ## โšก ๆ”ฏๆŒ็š„ๆจกๅž‹
42
+
43
+ | ๆไพ›ๅ•† | ๆ”ฏๆŒๆจกๅž‹ | ๆŽฅๅ…ฅๆ–นๅผ |
44
+ |--------|----------|----------|
45
+ | ๐ŸŸฃ **Anthropic Claude** | Claude 4.5 / 4.6 ๅ…จ็ณปๅˆ— | API Key |
46
+ | ๐Ÿ”ต **Google Gemini** | Gemini 3.1 Pro / Flash | API Key |
47
+ | ๐ŸŸข **OpenAI** | GPT-5.1 / GPT-5.2 | API Key |
48
+ | ๐ŸŸก **Vertex AI** | Gemini on Vertex | ๆœๅŠก่ดฆๅท |
49
+ | โšช **OpenAI-compat** | ไปปๆ„ๅ…ผๅฎน OpenAI ๆ ผๅผ็š„ๆœๅŠก | API Key |
50
+
51
+ ---
52
+
53
+ ## ๐Ÿš€ ๅฟซ้€ŸๆŽฅๅ…ฅ
54
+
55
+ ๅฐ†ไฝ ็š„ API Base URL ๆ›ฟๆขไธบๆœฌ Space ๅœฐๅ€ๅณๅฏ๏ผš
56
+
57
+ ```bash
58
+ # ๅŽŸๅง‹่ฏทๆฑ‚
59
+ curl https://api.anthropic.com/v1/messages ...
60
+
61
+ # ๆ›ฟๆขไธบๆœฌไปฃ็†
62
+ curl https://[user_name]-[space_name].hf.space/v1/messages \
63
+ -H "x-api-key: ไฝ ็š„่ฎฟ้—ฎๅฏ†้’ฅ" \
64
+ -H "Content-Type: application/json" \
65
+ -d '{"model": "claude-4-6-sonnet", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'
66
+ ```
67
+
68
+ ### Python ็คบไพ‹
69
+
70
+ ```python
71
+ import anthropic
72
+
73
+ client = anthropic.Anthropic(
74
+ api_key="ไฝ ็š„่ฎฟ้—ฎๅฏ†้’ฅ",
75
+ base_url="https://[user_name]-[space_name].hf.space",
76
+ )
77
+
78
+ message = client.messages.create(
79
+ model="claude-4-6-sonnet",
80
+ max_tokens=1024,
81
+ messages=[{"role": "user", "content": "ไฝ ๅฅฝ๏ผ"}]
82
+ )
83
+ print(message.content)
84
+ ```
85
+
86
+ ### OpenAI SDK ๅ…ผๅฎน
87
+
88
+ ```python
89
+ from openai import OpenAI
90
+
91
+ client = OpenAI(
92
+ api_key="ไฝ ็š„่ฎฟ้—ฎๅฏ†้’ฅ",
93
+ base_url="https://[user_name]-[space_name].hf.space/openai",
94
+ )
95
+
96
+ response = client.chat.completions.create(
97
+ model="gpt-5.1",
98
+ messages=[{"role": "user", "content": "ไฝ ๅฅฝ๏ผ"}]
99
+ )
100
+ ```
101
+
102
+ ---
103
+
104
+ ## ๐Ÿ—๏ธ ๆŠ€ๆœฏๆžถๆž„
105
+
106
+ ```
107
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
108
+ โ”‚ HuggingFace Space โ”‚
109
+ โ”‚ โ”‚
110
+ โ”‚ Client Request โ”‚
111
+ โ”‚ โ”‚ โ”‚
112
+ โ”‚ โ–ผ โ”‚
113
+ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
114
+ โ”‚ โ”‚ โ”‚ โ”‚ Supabase PostgreSQL โ”‚ โ”‚
115
+ โ”‚ โ”‚ CLIProxyAPI โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚ Token Store โ”‚ โ”‚
116
+ โ”‚ โ”‚ :7860 โ”‚ โ”‚ Config Store โ”‚ โ”‚
117
+ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
118
+ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
119
+ โ”‚ โ”‚ โ”‚
120
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
121
+ โ”‚
122
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
123
+ โ”‚ โ”‚
124
+ โ–ผ โ–ผ
125
+ Anthropic Google
126
+ Claude API Gemini API
127
+ ```
128
+
129
+ ---
130
+
131
+ ## โš™๏ธ ้ƒจ็ฝฒ้…็ฝฎ
132
+
133
+ ### ๅฟ…้œ€็Žฏๅขƒๅ˜้‡
134
+
135
+ ๅœจ HuggingFace Space **Settings โ†’ Secrets** ไธญ้…็ฝฎ๏ผš
136
+
137
+ | ๅ˜้‡ๅ | ่ฏดๆ˜Ž | ็คบไพ‹ |
138
+ |--------|------|------|
139
+ | `PGSTORE_DSN` | PostgreSQL ่ฟžๆŽฅๅญ—็ฌฆไธฒ | `postgresql://user:pass@host:6543/postgres?sslmode=require` |
140
+ | `MANAGEMENT_PASSWORD` | ็ฎก็†ๅŽๅฐๅฏ†็  | `your-secure-password` |
141
+
142
+ ## ๐Ÿ”‘ ๆทปๅŠ  API Key
143
+
144
+ ๆœๅŠกๅฏๅŠจๅŽ๏ผŒ้€š่ฟ‡็ฎก็†ๆŽฅๅฃๆทปๅŠ ไฝ ็š„ API Key๏ผš
145
+
146
+ ```bash
147
+ # ๆทปๅŠ  Claude Key
148
+ curl -X POST https://[user_name]-[space_name].hf.space/management/clients \
149
+ -H "Authorization: Bearer $MANAGEMENT_PASSWORD" \
150
+ -H "Content-Type: application/json" \
151
+ -d '{
152
+ "name": "my-client",
153
+ "claude-keys": ["sk-ant-api03-xxxxx"]
154
+ }'
155
+
156
+ # ๆทปๅŠ  Gemini Key
157
+ curl -X POST https://[user_name]-[space_name].hf.space/management/clients \
158
+ -H "Authorization: Bearer $MANAGEMENT_PASSWORD" \
159
+ -H "Content-Type: application/json" \
160
+ -d '{
161
+ "name": "my-client",
162
+ "gemini-keys": ["AIzaSy-xxxxx"]
163
+ }'
164
+ ```
165
+
166
+ ---
167
+
168
+ <div align="center">
169
+ <br/>
170
+
171
+ Built with โค๏ธ ยท Powered by [CLIProxyAPI](https://github.com/eceasy/cli-proxy-api) ยท Hosted on [HuggingFace](https://huggingface.co)
172
+
173
+ <br/>
174
+
175
+ </div>