Xác thực request

Mọi request tới ModelMart đều cần API key của tài khoản. Gửi key trong header chuẩn của OpenAI:

Authorization: Bearer mm_...

Lưu trữ key an toàn

Đặt key trong biến môi trường ở server hoặc secret manager. Không commit key, in key vào log, hoặc gửi key từ frontend. API key chỉ hiện đầy đủ một lần khi tạo.

export MODELMART_API_KEY="mm_..."
curl https://api.modelmart.ai/v1/chat/completions \
  -H "Authorization: Bearer ${MODELMART_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.6-sol","messages":[{"role":"user","content":"Tóm tắt tài liệu này"}]}'

Một key, nhiều model

Key dùng cho endpoint https://api.modelmart.ai/v1. Chọn model trong JSON bằng trường model; không cần đổi key theo provider.

Community

API key không được gọi model Community theo mặc định. Để dùng listing Community, bật allow_community trong cấu hình key và xác nhận rằng seller có thể thấy prompt. Không gửi dữ liệu bí mật hoặc dữ liệu cá nhân tới Community nếu bạn chưa đánh giá seller.

Thu hồi key

Khi key bị lộ, thu hồi ngay trên dashboard và tạo key mới. Đừng gửi key cũ trong yêu cầu hỗ trợ.