Spaces:
Paused
Paused
Upload README.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175---title: Oh My APIemoji: ๐พcolorFrom: pinkcolorTo: purplesdk: dockerpinned: truelicense: mit---
<div align="center"><br/>
``` โโโโโโโ โโโ โโโ โโโโ โโโโโโโ โโโ โโโโโโ โโโโโโโ โโโโโโโโโโโโโโโ โโโ โโโโโ โโโโโโโโโ โโโโ โโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโโโโ โโโ โโโโโโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโโโโ โโโ```
**็ปไธ AI API ไปฃ็็ฝๅ
ณ**
[](.)[](.)[](.)[](.)
<br/>
> ไธไธช่ฟ่กๅจ HuggingFace Space ไธ็้ซๆง่ฝ AI API ไปฃ็๏ผ<br/>> ็ปไธๆฅๅ
ฅ Claude ยท Gemini ยท OpenAI ยท Codex ยท Vertex AI
<br/>
</div>
---
## โก ๆฏๆ็ๆจกๅ
| ๆไพๅ | ๆฏๆๆจกๅ | ๆฅๅ
ฅๆนๅผ ||--------|----------|----------|| ๐ฃ **Anthropic Claude** | Claude 4.5 / 4.6 ๅ
จ็ณปๅ | API Key || ๐ต **Google Gemini** | Gemini 3.1 Pro / Flash | API Key || ๐ข **OpenAI** | GPT-5.1 / GPT-5.2 | API Key || ๐ก **Vertex AI** | Gemini on Vertex | ๆๅก่ดฆๅท || โช **OpenAI-compat** | ไปปๆๅ
ผๅฎน OpenAI ๆ ผๅผ็ๆๅก | API Key |
---
## ๐ ๅฟซ้ๆฅๅ
ฅ
ๅฐไฝ ็ API Base URL ๆฟๆขไธบๆฌ Space ๅฐๅๅณๅฏ๏ผ
```bash# ๅๅง่ฏทๆฑcurl https://api.anthropic.com/v1/messages ...
# ๆฟๆขไธบๆฌไปฃ็curl https://[user_name]-[space_name].hf.space/v1/messages \ -H "x-api-key: ไฝ ็่ฎฟ้ฎๅฏ้ฅ" \ -H "Content-Type: application/json" \ -d '{"model": "claude-4-6-sonnet", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'```
### Python ็คบไพ
```pythonimport anthropic
client = anthropic.Anthropic( api_key="ไฝ ็่ฎฟ้ฎๅฏ้ฅ", base_url="https://[user_name]-[space_name].hf.space",)
message = client.messages.create( model="claude-4-6-sonnet", max_tokens=1024, messages=[{"role": "user", "content": "ไฝ ๅฅฝ๏ผ"}])print(message.content)```
### OpenAI SDK ๅ
ผๅฎน
```pythonfrom openai import OpenAI
client = OpenAI( api_key="ไฝ ็่ฎฟ้ฎๅฏ้ฅ", base_url="https://[user_name]-[space_name].hf.space/openai",)
response = client.chat.completions.create( model="gpt-5.1", messages=[{"role": "user", "content": "ไฝ ๅฅฝ๏ผ"}])```
---
## ๐๏ธ ๆๆฏๆถๆ
```โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ HuggingFace Space โโ โโ Client Request โโ โ โโ โผ โโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโ โ โ โ Supabase PostgreSQL โ โโ โ CLIProxyAPI โโโโโโโโโบโ Token Store โ โโ โ :7860 โ โ Config Store โ โโ โ โ โโโโโโโโโโโโโโโโโโโโโโโโ โโ โโโโโโโโฌโโโโโโโ โโ โ โโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โโโโโโโโดโโโโโโโโ โ โ โผ โผ Anthropic Google Claude API Gemini API```
---
## โ๏ธ ้จ็ฝฒ้
็ฝฎ
### ๅฟ
้็ฏๅขๅ้
ๅจ HuggingFace Space **Settings โ Secrets** ไธญ้
็ฝฎ๏ผ
| ๅ้ๅ | ่ฏดๆ | ็คบไพ ||--------|------|------|| `PGSTORE_DSN` | PostgreSQL ่ฟๆฅๅญ็ฌฆไธฒ | `postgresql://user:pass@host:6543/postgres?sslmode=require` || `MANAGEMENT_PASSWORD` | ็ฎก็ๅๅฐๅฏ็ | `your-secure-password` |
## ๐ ๆทปๅ API Key
ๆๅกๅฏๅจๅ๏ผ้่ฟ็ฎก็ๆฅๅฃๆทปๅ ไฝ ็ API Key๏ผ
```bash# ๆทปๅ Claude Keycurl -X POST https://[user_name]-[space_name].hf.space/management/clients \ -H "Authorization: Bearer $MANAGEMENT_PASSWORD" \ -H "Content-Type: application/json" \ -d '{ "name": "my-client", "claude-keys": ["sk-ant-api03-xxxxx"] }'
# ๆทปๅ Gemini Key curl -X POST https://[user_name]-[space_name].hf.space/management/clients \ -H "Authorization: Bearer $MANAGEMENT_PASSWORD" \ -H "Content-Type: application/json" \ -d '{ "name": "my-client", "gemini-keys": ["AIzaSy-xxxxx"] }'```
---
<div align="center"><br/>
Built with โค๏ธ ยท Powered by [CLIProxyAPI](https://github.com/eceasy/cli-proxy-api) ยท Hosted on [HuggingFace](https://huggingface.co)
<br/>
</div>README.mdAdded+175