A beginner-friendly crash course on building Agentic AI applications using Node.js, the OpenAI SDK, and OpenRouter for model routing.
Agentic AI refers to AI systems that can autonomously plan, reason, and take actions to accomplish goals — going beyond simple question-answering to actively interacting with tools, APIs, and environments.
agentic-ai-crash-course/
├── backend/
│ ├── ai-agents.js # Main AI agent script
│ ├── package.json # Node.js dependencies
│ └── pnpm-lock.yaml # Lockfile (pnpm)
└── README.md
| Tool | Purpose |
|---|---|
| Node.js | JavaScript runtime |
| OpenAI SDK | API client for chat completions |
| OpenRouter | Unified API gateway for multiple LLMs |
| dotenv | Environment variable management |
| pnpm | Fast, efficient package manager |
- Node.js v18+
- pnpm v10+
- An OpenRouter API key
# Clone the repository
git clone <REPO_URL>
cd <REPO_NAME>/backend
# Install dependencies
pnpm installCreate a .env file in the backend/ directory:
OPENROUTER_API_KEY=your_openrouter_api_key_herenode ai-agents.jsai-agents.js initializes the OpenAI client pointed at the OpenRouter base URL, then sends a chat completion request to the stepfun/step-3.5-flash:free model asking "What is Agentic AI?". The response is printed to the console.