Skip to main content
Mastra is a framework for building and deploying AI-powered features using a modern JavaScript stack powered by the Vercel AI SDK. Integrating with Together AI provides access to a wide range of models for building intelligent agents.

Getting started

  1. Create a new Mastra project

    First, create a new Mastra project using the CLI:
    During the setup, the system prompts you to name your project, choose a default provider, and more. Feel free to use the default settings.
  2. Install dependencies

    To use Together AI with Mastra, install the required packages:
  3. Configure environment variables

    Create or update your .env file with your Together AI API key:
  4. Configure your agent to use Together AI

    Now, update your agent configuration file, typically src/mastra/agents/weather-agent.ts, to use Together AI models:
    src/mastra/agents/weather-agent.ts
  5. Running the application

    Since your agent is now configured to use Together AI, run the Mastra development server:
    Open the Mastra Playground and Mastra API to test your agents, workflows, and tools.

Next Steps