n8n / Zapier
n8n và Zapier là automation platforms — gọi nexai API qua HTTP Request node để tự động hóa workflow: phân tích email, tạo content, classify support ticket...
Bạn cần chuẩn bị
·n8n self-hosted hoặc Cloud
·API Key (tạo ở trang API Keys)
·5 phút
n8n — HTTP Request node
1
Thêm HTTP Request node
Trong workflow editor, kéo node 'HTTP Request' vào canvas.
2
Cấu hình node
Set các field như sau (lưu ý phải qua 'Generic Credential Type' trước khi đến Header Auth):
Method: POST
URL: https://nexai.newdev.net/api/v1/chat/completions
Authentication: Generic Credential Type
Generic Auth Type: Header Auth
Header Name: Authorization
Header Value: Bearer sk-billing-xxx
Send Body: JSON
Body:
{
"model": "gpt-4o-mini",
"messages": [
{"role": "user", "content": "{{ $json.input }}"}
]
}Lưu credential trong n8n Credentials store (gear icon → New) thay vì hardcode key vào node — dễ rotate sau này.
3
Map input từ node trước
Trong body, dùng expression {{ $json.field }} để dùng output node trước. Output AI sẽ ở response.choices[0].message.content.
Zapier — Webhooks by Zapier
Zapier không có node OpenAI custom URL nên dùng Webhooks by Zapier → POST với cùng payload trên.
Xong! Workflow của bạn đã gọi được nexai API.
Cân nhắc
gpt-4o-mini cho automation high-volume — chi phí credit thấp nhất. Reserve gpt-5.5 cho task phức tạp.