Skip to main content
This guide builds a complete Dolphinclaw agent that calls Groq’s OpenAI-compatible API to generate a short daily topic update using the llama-3.1-8b-instant model, then posts the result to a Discord channel via a webhook. By the end you will have a working agent you can start from the Dolphinclaw dashboard with a custom topic.

What this agent does

When started, the agent accepts an optional topic input (defaulting to "crypto market"). It sends a prompt to Groq asking for a three-sentence update on that topic, then posts the response to a Discord channel using a webhook URL. The agent returns a success status and exits.

Prerequisites

Before you begin, make sure you have:
  • A Groq API key from console.groq.com
  • A Discord webhook URL for the channel you want to post to

Agent code

Create a file named dolphinclaw.agent.ts (or index.js if you prefer plain JavaScript) at the root of your project.

Dependencies

Add the following packages to your package.json:
Install them before pushing your code:

Environment variables

This agent requires two environment variables to be set in the Dolphinclaw dashboard before you start it: See Setting environment variables for instructions on adding these in the dashboard.
You can pass a custom topic value when starting the agent from the dashboard. Open the Run panel, add a JSON input object such as {"topic": "AI news"}, and the agent will generate an update on that topic instead of the default "crypto market". If no input is provided, the agent falls back to "crypto market" automatically.