OpenServ

Build a Custom Agent

A guided build with video and steps.

Watch: Build a custom agent.

Build a Custom Agent

Starter repository

To get going fast, clone the Hyperliquid demo agent:

The repo is structured around the OpenServ TypeScript SDK:

  • capabilities/
    • test.ts: basic “hello world” style capability you can use to verify that the agent server is wired correctly.
    • trade.ts: more advanced Hyperliquid trading capability (documented in more detail under the Hyperliquid Agent example).
  • agent-server.ts: boots the server and registers capabilities in a modular way.

Environment variables

Create a .env file with:

# Required
OPENSERV_API_KEY=your_openserv_api_key_here

# Optional
PORT=7380
HYPERLIQUID_TESTNET=false  # set to 'true' for testnet
  • OPENSERV_API_KEY is created from the Your Agents → Create Secret Key action after registering the agent via Add Agent.
  • PORT is optional (defaults to 7380).
  • HYPERLIQUID_TESTNET controls whether the agent talks to mainnet or testnet.

Once the agent server is running, you can expose it via ngrok or a production domain, register it in Add Agent, and then call its capabilities in natural language from workflows or other agents.