สองบรรทัด ทุกเครื่องมือ
ทุกเครื่องมือข้างล่างใช้ของสองอย่างเหมือนกัน: base URL กับคีย์ มีสอง base URL เพราะมีสองโปรโตคอล - เลือกอันที่เครื่องมือคุณพูดอยู่แล้ว ไม่ต้องแปลงอะไร
ถ้าย้ายมาแล้วต้องแก้โค้ดหลายจุด นั่นคือสัญญาณว่า API ออกแบบผิด ที่นี่เปลี่ยนสองค่า: host กับ key
| Base URL | Protocol | Used by |
|---|---|---|
https://lazarus-th.duckdns.org/v1 | OpenAI-compatible | Chat Completions and Responses. Codex, Cursor, OpenCode, Kilo Code, Pi, Kimi, Grok, Hermes and the SDKs. |
https://lazarus-th.duckdns.org | Anthropic-compatible | Messages API. Claude Code and the Anthropic SDKs. No /v1 suffix. |
| Method | Path | Returns |
|---|---|---|
| POST | /v1/chat/completions | Completion, or an SSE stream when stream:true |
| POST | /v1/messages | Anthropic-shaped completion |
| POST | /v1/images/generations | Image generation |
| GET | /v1/models | Every model the key can reach. Needs auth. |
| GET | /api/status | Public instance status, no auth |
| GET | /api/user/self | Balance and quota for the calling key |
Verify the key in one call
List the models the key can reach. A JSON list back means the key and the URL are both right. A 401 means the key is wrong or expired.
curl https://lazarus-th.duckdns.org/v1/models \ -H "Authorization: Bearer sk-..."
Chat completions
Request body is the OpenAI shape. model is the only field that selects a route.
curl https://lazarus-th.duckdns.org/v1/chat/completions \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{
"model": "LARP",
"messages": [{ "role": "user", "content": "Say hello in five words." }]
}'
Response carries a usage block on every call: prompt_tokens, completion_tokens, total_tokens, and reasoning_tokens where the model reports it.
| Field | Type | Default | Meaning |
|---|---|---|---|
model | string | required | Model ID from the catalog |
messages | array | required | Chat messages array |
temperature | number | 1.0 | 0–2, randomness |
max_tokens | integer | null | Max output tokens |
stream | boolean | false | Stream via SSE |
top_p | number | 1.0 | Nucleus sampling |
Streaming
Set stream:true and the response becomes text/event-stream. Each frame is a data: line holding a delta; the last one is data: [DONE].
Errors
The API answers with a standard HTTP status and a JSON body that names the error. The code never changes, so you can match on it; the message is written for humans. Every response also carries an X-Oneapi-Request-Id header - quote it when you open a key.
Two shapes, depending on the endpoint:
// OpenAI-compatible · /v1/chat/completions
{ "error": { "message": "Invalid API key",
"type": "invalid_request_error",
"code": "invalid_api_key" } }
// Anthropic-compatible · /v1/messages
{ "type": "error",
"error": { "type": "authentication_error",
"message": "Invalid API key",
"code": "invalid_api_key" } }
| Status | Code | When it happens | What to do |
|---|---|---|---|
| 400 | invalid_json | The body could not be parsed as JSON. | Check quotes, commas, and the Content-Type: application/json header. |
| 400 | missing_model | The request has no model field. | Add a model id from the catalog. |
| 400 | bad_request | The model rejected a parameter - wrong type, unsupported option, content too long. | The message repeats the model's reason. Fix the parameter and resend. |
| 401 | missing_api_key | No key was sent. Every endpoint needs one, including GET /v1/models. | Send Authorization: Bearer sk-… on every request. |
| 401 | invalid_api_key | The key does not exist or was deleted. | Copy it again from the console, or create a new one. |
| 402 | insufficient_quota | The wallet has no remaining quota. | Top up. Minimum $3. |
| 403 | not_in_plan | No access to this model on the current key. | Call GET /v1/models with the same key, or pick another model. |
| 404 | model_not_found | The model id is unknown or was retired. | Use an id from /v1/models. |
| 404 | not_found | The path or method does not exist. | Use POST /v1/chat/completions, GET /v1/models, or POST /v1/images/generations. |
| 429 | rate_limit_exceeded | Too many requests in a short window. | Slow down. Retry with exponential backoff. |
| 500 | server_error | The gateway hit an unexpected error. | Retry with backoff. Nothing was charged if the request failed. |
| 503 | upstream_unavailable | The model timed out or is down for maintenance. | Retry in a moment or switch models. Nothing was charged. |
การคิดเงิน
คิดเป็นชั่วโมง ไม่ใช่ต่อ token หนึ่งชั่วโมงสิบบาท และทุกอย่างในชั่วโมงนั้นไม่ถูกมิเตอร์ เวลาที่ซื้อแล้วต่อจากของเดิมเสมอ ไม่รีเซ็ต และไม่หมดอายุกลางคำขอ
10 บาท = 1 ชั่วโมง 79 บาท = 24 ชั่วโมง 789 บาท = 30 วัน # เวลาถูกเขียนลง keys.expires โดยตรง # คีย์ที่หมดอายุแล้วตอบ 401 จนกว่าจะเติม
ช่องทางที่เปิดอยู่: โอนผ่านธนาคาร (ธ.ก.ส. 020254255452), คริปโต (BTC / ETH / SOL) และพร้อมเพย์เมื่อเปิดพร็อกซีแล้ว คริปโตเป็นช่องทางเดียวที่ระบบตรวจเองอัตโนมัติ โดยเฝ้าที่อยู่บนเครือข่ายทุก 45 วินาที
ดูยอดและประวัติได้ที่ หน้าบัญชี หลังเข้าสู่ระบบ
Python
from openai import OpenAI
client = OpenAI(
base_url="https://lazarus-th.duckdns.org/v1",
api_key="sk-...",
)
r = client.chat.completions.create(
model="Mythos China",
messages=[{"role": "user", "content": "hello"}],
)
print(r.choices[0].message.content)
Node
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://lazarus-th.duckdns.org/v1",
apiKey: "sk-...",
});
const r = await client.chat.completions.create({
model: "LAZARUS",
messages: [{ role: "user", content: "hello" }],
});
Claude Code
Claude Code speaks the Anthropic protocol, so the base URL has no /v1. Set three variables in the terminal you run it from.
export ANTHROPIC_BASE_URL="https://lazarus-th.duckdns.org" export ANTHROPIC_AUTH_TOKEN="sk-..." export ANTHROPIC_MODEL="LARP"
To make it permanent, put the same three values in the env block of ~/.claude/settings.json. Merge into an existing file rather than replacing it.
Your tool is not listed
Any tool that lets you set an OpenAI or Anthropic base URL works here. Look for a Base URL or Custom provider field, paste the URL and your key, and use a model from the catalog.
Webhooks
ยังไม่มี webhook ในรอบนี้ ระบบตรวจการชำระเงินฝั่งเซิร์ฟเวอร์และอัปเดตเวลาให้เอง หน้าเว็บแค่ถามสถานะออเดอร์ซ้ำทุกห้าวินาที ไม่มีคอลแบ็กที่ต้องตั้งค่า
Keys
Keys are created in the console under Tokens. A key carries a quota, an optional model allow-list, and an optional IP allow-list. Revoking a key takes effect on the next request, no cache to wait out.
