Prepare Your Org to Access the Models API
Learning Objectives
After completing this unit, you’ll be able to:
- Set up your Salesforce DX environment.
- Sign up for an AI Playground.
- Authorize your AI Playground in Visual Studio Code.
- Create a Salesforce DX Project.
The Next Step for DreamHouse Realty
After planning her first AI project with DreamHouse Realty, Maria needs to set up her org and environment so that she can begin building her dashboard. The Models API is accessible from any org with Einstein Generative AI and Data 360 enabled.
Sign Up for a Trial Org with Einstein Generative AI
To complete this project, you need a special, limited-time custom playground that contains Einstein AI and Data 360.
- Click Create Playground.
- Your new org is automatically attached to your Trailhead account!
- Make note of your org's expiration date and complete this badge before then.
Reset your password.
- Launch your Trailhead Playground by clicking Launch.
- Click
and select Setup.
- In Quick Find, search for and select Users.
- Locate your name on the list of users. Check the box next to your name. Take note of the username. This is the username for your Trailhead Playground.
- Click Reset Password(s) and OK. This sends an email to the email address associated with your username. Be sure to check your spam folder if you don't see the email.
- Click the link in the email.
- Enter a new password, confirm it, and click Change Password.
If you haven’t already, launch your AI playground.
- Click the gear icon (
) and click Setup. The Setup page opens in a new tab.
- In the Quick Find search box, search for and select Einstein Setup.
- Ensure the Turn on Einstein toggle is set to On (
).
To ensure that your Lightning web component is immediately visible when deployed, turn off browser caching in your org.
- Click the gear icon (
) and click Setup. The Setup page opens in a new tab.
- In the Quick Find search box, search for and select Session Settings.
- Under Caching, deselect “Enable secure and persistent browser caching to improve performance.”

Install the Salesforce Command Line Interface (CLI)
Use the Salesforce CLI to control the full application life cycle of your Salesforce apps. With it you can easily create environments for development and testing, synchronize source code between your orgs and version control system (VCS), and execute tests.
See the Salesforce CLI Setup Guide for complete installation instructions.
- Install the CLI from Salesforce CLI.
- Confirm the CLI is properly installed and on the latest version by running the following command from the command line.
sf update
You should see output like Updating CLI…
Install Salesforce Extensions for Visual Studio Code
Visual Studio Code is the go-to code editor for Salesforce developers. It's free, open-source, and available for Windows, Linux, and macOS. This editor has easy-to-install extensions for syntax highlighting, code completion, and more.
If you don’t already have them, follow the instructions to install Visual Studio Code and the recommended Salesforce Extension Pack.
- Download and install the latest version of Visual Studio Code for your operating system. If you already have Visual Studio Code installed, there’s no need to reinstall it.
- Launch Visual Studio Code.
- On the left toolbar, click the Extensions icon(
).
- Search for
Salesforce Extension Packand click Install.
Create a Project
- In Visual Studio Code, open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS).
- Type
SFDX.
- Select SFDX: Create Project.
- Press Enter to accept the standard option.
- Enter
ModelsAPILWCas the project name.
- Press Enter.
- Select a folder to store the project.
- Click Create Project. You should see something like this as your base setup.

Connect Your Visual Studio Code Environment
Before you can create a Lightning web component, you must connect your AI Playground to your VS Code environment.
Authorize Your AI Playground
In VS Code, authorize your custom Playground.
- In Visual Studio Code, open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS).
- Type
SFDX.
- Select SFDX: Authorize an Org.
- Press Enter to accept the Project Default login URL option.
- Press Enter to accept the default alias. This opens the Salesforce login in a separate browser window.
- Log in using your AI Playground credentials.
- If prompted to allow access, click Allow.
- After you authenticate in the browser, the CLI remembers your credentials. The success message should look like this:

You’re now ready to complete the challenge and move on to the next unit. Note that this challenge only checks if Einstein is enabled in Setup, but all of the previous steps are required to start building the dashboard in the next unit.
