Nexa AI
Docs

Tài liệu Nexa AI cho developer

Hướng dẫn viết prompt hiệu quả, API reference, quickstart và best practices từ team Nexa AI.

Quickstart

Quickstart trong 5 phút

Chỉ cần 5 bước để generate website đầu tiên qua API.

1

Lấy API key

Vào Settings → API trong dashboard, click Generate New Key. Copy ngay vì key chỉ hiển thị 1 lần.

# .env
NEXA_API_KEY=nx_live_xxxxx
2

Cài SDK

Cài package chính thức bằng npm hoặc pnpm.

npm install @nexa-ai/sdk
3

Tạo client

Khởi tạo client với API key và locale mặc định.

import { Nexa } from '@nexa-ai/sdk';

const nexa = new Nexa({
  apiKey: process.env.NEXA_API_KEY,
  locale: 'vi',
});
4

Generate website

Gọi method generate với prompt mô tả website bạn cần.

const result = await nexa.generate({
  prompt: 'Landing page cho startup SaaS B2B chuyên về logistics',
  template: 'saas-modern',
});
5

Deploy

Lấy preview URL từ result hoặc trigger deploy lên Vercel.

console.log(result.preview_url);
await result.deploy({ provider: 'vercel' });

Code

Một ví dụ thực tế

Đoạn code đầy đủ để bạn copy-paste và chạy ngay — gồm initialization, generation, error handling và deploy.

import { Nexa } from '@nexa-ai/sdk';

const nexa = new Nexa({ apiKey: process.env.NEXA_API_KEY });

async function buildLanding() {
  try {
    const result = await nexa.generate({
      prompt: 'Landing page cho dịch vụ tư vấn tài chính cá nhân',
      template: 'consulting-clean',
      locale: 'vi',
    });
    console.log('Preview:', result.preview_url);
    await result.deploy({ provider: 'vercel', projectName: 'finconsult' });
  } catch (err) {
    console.error('Generation failed:', err.message);
  }
}

buildLanding();

Hỗ trợ developer

Cần hỗ trợ tích hợp?

Discord cộng đồng có 5.000+ developer đang dùng Nexa AI. Team Nexa thường xuyên active và phản hồi trong vòng vài giờ.