API reference
Endpoint ទាំងអស់នៃ Laalaa Gateway — ទម្រង់ OpenAI និង Anthropic។
Base URLs
OpenAI-compatible
https://api.laalaa.me/v1Anthropic-compatible
https://api.laalaa.meEndpoints
GET
/v1/modelsបញ្ជី model ដែល key អាចហៅបាន។POST
/v1/chat/completionsOpenAI Chat Completions (stream: true បាន)។POST
/v1/responsesOpenAI Responses API shape។POST
/v1/messagesAnthropic Messages shape — ប្រើ x-api-key + anthropic-version។POST
/v1/images/generationsOpenAI Images API shape។GET
/v1/usageកូតា និងការប្រើប្រាស់ key បច្ចុប្បន្ន។Vendor endpoints
សម្រាប់ resellers — ផ្ទៀងផ្ទាត់ដោយ vendor token មិនមែន sk- key ទេ។ ឯកសារលម្អិតត្រូវបានផ្ដល់ដោយផ្ទាល់។
POST
/api/keysបង្កើត key (scope keys:create)។GET
/api/server-optionsរាយ Server Options ដែលអាចភ្ជាប់បាន។Endpoint discovery
Probe សាធារណៈ (គ្មាន auth)៖
bash
curl https://api.laalaa.me/v1json
{
"service": "laalaa-gateway",
"status": "ok",
"endpoints": {
"chat_completions": "POST /v1/chat/completions",
"responses": "POST /v1/responses",
"messages": "POST /v1/messages",
"images_generations": "POST /v1/images/generations",
"models": "GET /v1/models",
"usage": "GET /v1/usage"
},
"compatible_with": ["openai", "anthropic"]
}ភាគច្រើនបំផុត៖ /v1/chat/completions និង /v1/messages ដំណើរការជាមួយ SDK ដែលអ្នកមានរួច។
ភាពត្រូវគ្នា
- Header ការពារ៖
Authorization: Bearerឬx-api-key - Anthropic calls ត្រូវការ
anthropic-version: 2023-06-01 - Errors ជា envelope តែមួយ
ទំព័រនេះមានប្រយោជន៍?