Nguyên tắc thiết kế API
OpenAPI 3.1 là nguồn sự thật; code client/server sinh tự động , cấm sửa tay file sinh. REST /v1 , JSON, camelCase ; lỗi dạng { error: { code, message } } . Phân trang cursor ?cursor=&limit= , idempotency key cho POST thanh toán. Xác thực: Bearer JWT từ loginv4 , scope theo workspace. Realtime: SSE cho web/app, WebSocket cho extension lệnh 2 chiều . Rate limit trả 429 + Retry After ; client tự backoff không spam server .