Use the course setup guide for the complete instructions. It covers local development and Codespaces, Foundry project creation, model deployment, API keys, environment variables, and a live companion app check.
The companion app already uses the openai JavaScript package. You do not need to install @azure/openai, create a hub, or replace the app's client code.
Create .env in the repository root with these values from your Foundry resource:
AI_API_KEY=your_microsoft_foundry_api_key
AI_ENDPOINT=https://your-resource.openai.azure.com/openai/v1
AI_MODEL=gpt-5-miniAI_MODEL must be your deployment name. AI_ENDPOINT must be the Azure OpenAI-compatible API base URL, not the Foundry project URL or a full chat-completion request URL.
Follow Set Up Microsoft Foundry to obtain these values, then Configure Environment Variables.
From the repository root:
npm ci
npm ci --prefix app
npm --prefix app startOpen http://localhost:3000, select a character, and send a message. In Codespaces, keep port 3000 private.
For an existing environment file:
ENV_FILE="$HOME/.env" npm --prefix app startSee Test Your Setup and Troubleshooting for verification and error handling.