API Documentation
OpenAI-compatible · ใช้ได้กับ SDK และแอปที่ตั้ง Base URL เองได้
Base URL
https://key.131199999.xyz/v1
HTTPS
Model
deepseek-eco
ตัวเดียว (ล็อกไว้)
Auth
Bearer JXK-…
คีย์จากแดชบอร์ด
Rate limit
30 / นาที
ต่อคีย์
Endpoints
| Method | Path | คำอธิบาย |
|---|---|---|
| POST | /v1/chat/completions | แชท (รองรับ stream) |
| GET | /v1/models | รายชื่อโมเดล (มีตัวเดียว) |
| GET | /v1/me | เครดิต + สรุป usage ของคีย์ |
ราคา
| ประเภท token | ราคา / 1M |
|---|---|
| Input (prompt) | ฿15.00 |
| Output (completion) | ฿60.00 |
| Cache read | ฿0.50 |
| Cache write | ฿15.00 |
ตัวอย่าง
curl
curl https://key.131199999.xyz/v1/chat/completions \
-H "Authorization: Bearer YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-eco",
"messages": [{"role":"user","content":"อธิบาย PromptPay ให้ฟังหน่อย"}],
"max_tokens": 512
}'Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(base_url="https://key.131199999.xyz/v1", api_key="YOUR-KEY")
r = client.chat.completions.create(
model="deepseek-eco",
messages=[{"role": "user", "content": "สวัสดี"}],
)
print(r.choices[0].message.content)
print(r.usage) # prompt_tokens / completion_tokensNode.js (openai)
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://key.131199999.xyz/v1", apiKey: "YOUR-KEY" });
const r = await client.chat.completions.create({
model: "deepseek-eco",
messages: [{ role: "user", content: "สวัสดี" }],
});
console.log(r.choices[0].message.content, r.usage);Stream
// เปิด stream ได้เหมือน OpenAI ปกติ
const stream = await client.chat.completions.create({
model: "deepseek-eco",
messages: [{ role: "user", content: "เขียนกลอนสั้น ๆ" }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}Response (usage)
ทุก response ส่ง usage กลับตามมาตรฐาน OpenAI — และ log เดียวกันนี้อยู่ในแดชบอร์ดของคุณ
{
"id": "resp_...",
"object": "chat.completion",
"choices": [{ "index": 0, "message": { "role": "assistant", "content": "..." }, "finish_reason": "stop" }],
"usage": {
"prompt_tokens": 47,
"completion_tokens": 17,
"total_tokens": 64,
"prompt_tokens_details": { "cached_read_tokens": 0, "cached_tokens": 0 }
}
}Error codes
| HTTP | ความหมาย | ทำอะไรต่อ |
|---|---|---|
| 401 | คีย์ผิด/ถูกเพิกถอน | สร้างคีย์ใหม่ในแดชบอร์ด |
| 402 | เครดิตหมด | เติมเครดิตที่หน้า /buy |
| 404 | โมเดลไม่ถูกต้อง | ใช้ deepseek-eco เท่านั้น |
| 429 | ยิงถี่เกิน 30 ครั้ง/นาที | หน่วงแล้วลองใหม่ |
| 502/503 | ต้นทางขัดข้อง | ลองใหม่ภายหลัง (ไม่คิดเงิน) |
ข้อควรรู้
· ระบบจะส่ง max_tokens สูงสุดที่ 8192 แม้ client จะขอมากกว่า
· เนื้อหา prompt/คำตอบไม่ถูกเก็บในฐานข้อมูลของเรา — เก็บเฉพาะจำนวน token, สถานะ, ต้นทุน เพื่อคิดเงินและแสดง log
· คำขอถูกส่งต่อไปยังผู้ให้บริการโมเดลต้นทาง ซึ่งมีนโยบายข้อมูลของเขาเอง
· เครดิตถูกหักตาม usage จริงหลังจบ request — ถ้าการเชื่อมต่อหลุดกลางทางและไม่ได้ usage จะประมาณจากความยาวข้อความ (ทำเครื่องหมาย est)
· เนื้อหา prompt/คำตอบไม่ถูกเก็บในฐานข้อมูลของเรา — เก็บเฉพาะจำนวน token, สถานะ, ต้นทุน เพื่อคิดเงินและแสดง log
· คำขอถูกส่งต่อไปยังผู้ให้บริการโมเดลต้นทาง ซึ่งมีนโยบายข้อมูลของเขาเอง
· เครดิตถูกหักตาม usage จริงหลังจบ request — ถ้าการเชื่อมต่อหลุดกลางทางและไม่ได้ usage จะประมาณจากความยาวข้อความ (ทำเครื่องหมาย est)