Update README.md
Browse files
README.md
CHANGED
|
@@ -1,15 +1,18 @@
|
|
| 1 |
---
|
| 2 |
title: CPA
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
-
pinned:
|
|
|
|
| 8 |
---
|
| 9 |
|
|
|
|
|
|
|
| 10 |
|
| 11 |
```
|
| 12 |
-
โโโโโโโ โโโ โโโ โโโโ โโโโโโโ โโโ โโโโโโ โโโโโโโ โโโ
|
| 13 |
โโโโโโโโโโโโ โโโ โโโโโ โโโโโโโโโ โโโโ โโโโโโโโโโโโโโโโโโโ
|
| 14 |
โโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
| 15 |
โโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโ โโโโโโโโโโโโโโโ โโโ
|
|
@@ -17,29 +20,41 @@ pinned: false
|
|
| 17 |
โโโโโโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโโโโ โโโ
|
| 18 |
```
|
| 19 |
|
| 20 |
-
็ปไธ AI API ไปฃ็็ฝๅ
ณ
|
| 21 |
|
| 22 |
-
Version
|
| 23 |
-
SDK
|
| 24 |
-
Status
|
| 25 |
-
License
|
| 26 |
|
|
|
|
| 27 |
|
| 28 |
-
ไธไธช่ฟ่กๅจ HuggingFace Space ไธ็้ซๆง่ฝ AI API ไปฃ็๏ผ
|
|
|
|
| 29 |
|
| 30 |
-
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
:high_voltage: ๆฏๆ็ๆจกๅ
|
| 34 |
-
ๆไพๅ ๆฏๆๆจกๅ ๆฅๅ
ฅๆนๅผ
|
| 35 |
-
:purple_circle: Anthropic Claude Claude 4.5 / 4.6 ๅ
จ็ณปๅ API Key
|
| 36 |
-
:blue_circle: Google Gemini Gemini 3.1 Pro / Flash API Key
|
| 37 |
-
:green_circle: OpenAI GPT-5.1 / GPT-5.2 API Key
|
| 38 |
-
:yellow_circle: Vertex AI Gemini on Vertex ๆๅก่ดฆๅท
|
| 39 |
-
:white_circle: OpenAI-compat ไปปๆๅ
ผๅฎน OpenAI ๆ ผๅผ็ๆๅก API Key
|
| 40 |
-
:rocket: ๅฟซ้ๆฅๅ
ฅ
|
| 41 |
ๅฐไฝ ็ API Base URL ๆฟๆขไธบๆฌ Space ๅฐๅๅณๅฏ๏ผ
|
| 42 |
|
|
|
|
| 43 |
# ๅๅง่ฏทๆฑ
|
| 44 |
curl https://api.anthropic.com/v1/messages ...
|
| 45 |
|
|
@@ -48,7 +63,11 @@ curl https://[user_name]-[space_name].hf.space/v1/messages \
|
|
| 48 |
-H "x-api-key: ไฝ ็่ฎฟ้ฎๅฏ้ฅ" \
|
| 49 |
-H "Content-Type: application/json" \
|
| 50 |
-d '{"model": "claude-4-6-sonnet", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
import anthropic
|
| 53 |
|
| 54 |
client = anthropic.Anthropic(
|
|
@@ -62,7 +81,11 @@ message = client.messages.create(
|
|
| 62 |
messages=[{"role": "user", "content": "ไฝ ๅฅฝ๏ผ"}]
|
| 63 |
)
|
| 64 |
print(message.content)
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
from openai import OpenAI
|
| 67 |
|
| 68 |
client = OpenAI(
|
|
@@ -74,7 +97,13 @@ response = client.chat.completions.create(
|
|
| 74 |
model="gpt-5.1",
|
| 75 |
messages=[{"role": "user", "content": "ไฝ ๅฅฝ๏ผ"}]
|
| 76 |
)
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 79 |
โ HuggingFace Space โ
|
| 80 |
โ โ
|
|
@@ -95,16 +124,26 @@ response = client.chat.completions.create(
|
|
| 95 |
โผ โผ
|
| 96 |
Anthropic Google
|
| 97 |
Claude API Gemini API
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
ๆๅกๅฏๅจๅ๏ผ้่ฟ็ฎก็ๆฅๅฃๆทปๅ ไฝ ็ API Key๏ผ
|
| 107 |
|
|
|
|
| 108 |
# ๆทปๅ Claude Key
|
| 109 |
curl -X POST https://[user_name]-[space_name].hf.space/management/clients \
|
| 110 |
-H "Authorization: Bearer $MANAGEMENT_PASSWORD" \
|
|
@@ -122,8 +161,15 @@ curl -X POST https://[user_name]-[space_name].hf.space/management/clients \
|
|
| 122 |
"name": "my-client",
|
| 123 |
"gemini-keys": ["AIzaSy-xxxxx"]
|
| 124 |
}'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
-
Built with
|
| 127 |
|
|
|
|
| 128 |
|
| 129 |
-
|
|
|
|
| 1 |
---
|
| 2 |
title: CPA
|
| 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 |
โโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโ โโโโโโโโโโโโโโโ โโโ
|
|
|
|
| 20 |
โโโโโโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโโโโ โโโ
|
| 21 |
```
|
| 22 |
|
| 23 |
+
**็ปไธ AI API ไปฃ็็ฝๅ
ณ**
|
| 24 |
|
| 25 |
+
[](.)
|
| 26 |
+
[](.)
|
| 27 |
+
[](.)
|
| 28 |
+
[](.)
|
| 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 |
|
|
|
|
| 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(
|
|
|
|
| 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(
|
|
|
|
| 97 |
model="gpt-5.1",
|
| 98 |
messages=[{"role": "user", "content": "ไฝ ๅฅฝ๏ผ"}]
|
| 99 |
)
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
---
|
| 103 |
+
|
| 104 |
+
## ๐๏ธ ๆๆฏๆถๆ
|
| 105 |
+
|
| 106 |
+
```
|
| 107 |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
| 108 |
โ HuggingFace Space โ
|
| 109 |
โ โ
|
|
|
|
| 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" \
|
|
|
|
| 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>
|