File size: 5,848 Bytes
847be82 5c18228 847be82 5c18228 847be82 5c18228 9a325d1 5c18228 9a325d1 5c18228 9a325d1 5c18228 03e51a9 5c18228 9a325d1 5c18228 9a325d1 5c18228 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | ---
title: Oh My API
emoji: ๐พ
colorFrom: pink
colorTo: purple
sdk: docker
pinned: true
license: 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://ohmyapi-2api.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 ็คบไพ
```python
import anthropic
client = anthropic.Anthropic(
api_key="ไฝ ็่ฎฟ้ฎๅฏ้ฅ",
base_url="https://ohmyapi-2api.hf.space",
)
message = client.messages.create(
model="claude-4-6-sonnet",
max_tokens=1024,
messages=[{"role": "user", "content": "ไฝ ๅฅฝ๏ผ"}]
)
print(message.content)
```
### OpenAI SDK ๅ
ผๅฎน
```python
from openai import OpenAI
client = OpenAI(
api_key="ไฝ ็่ฎฟ้ฎๅฏ้ฅ",
base_url="https://ohmyapi-2api.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?default_query_exec_mode=simple_protocol` |
| `MANAGEMENT_PASSWORD` | ็ฎก็ๅๅฐๅฏ็ | `your-secure-password` |
## ๐ ๆทปๅ API Key
ๆๅกๅฏๅจๅ๏ผ้่ฟ็ฎก็ๆฅๅฃๆทปๅ ไฝ ็ API Key๏ผ
```bash
# ๆทปๅ Claude Key
curl -X POST https://ohmyapi-2api.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://ohmyapi-2api.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> |