DigiNest AI / Mô hình / Tài liệu
Tài liệu Tích hợp API
Base URL Gateway
Dùng trực tiếp đường dẫn này thay cho OpenAI Endpoint trong công cụ lập trình của bạn:
http://localhost:3000/api/v1curl http://localhost:3000/api/v1/chat/completions \
-H "Authorization: Bearer sk-dn-live-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{"role": "system", "content": "Bạn là trợ lý kỹ thuật AI."},
{"role": "user", "content": "Viết hàm binary search bằng TypeScript"}
],
"temperature": 0.4
}'Endpoints hỗ trợ
- GET /api/v1/models
Liệt kê toàn bộ model AI đang bật và giá.
- POST /api/v1/chat/completions
Sinh hội thoại, kiểm tra Guardrail & trừ token gói.
Mã lỗi chuẩn HTTP
401 UnauthorizedSai hoặc thu hồi API Key
403 ForbiddenChặn bởi Guardrail / IP
429 Rate / QuotaHết token hoặc vượt trần