Create a New Project

Use our CLI to create a new SpinAI project:

npm create spinai-app@latest my-first-agent
cd my-first-agent

Configure Environment

Create a .env file with your OpenAI API key:

OPENAI_API_KEY=your_api_key_here

Run Your Agent

Start your agent:

npm run dev

That’s it! Your agent will now:

  1. Receive the user’s question
  2. Decide to use the getWeather action
  3. Execute the action
  4. Provide a response

Next Steps