Skip to main content
Use Cursor to build trading bots and applications powered by The Brain. This guide shows you how to integrate the Gigabrain API into your development workflow with Cursor’s AI assistant.

Prerequisites

  • Cursor editor installed
  • Gigabrain API key from your Profile
  • Basic knowledge of Python or JavaScript

Quick Start

1

Get your API key

  1. Sign in to Gigabrain
  2. Go to Profile → API Keys
  3. Generate a new API key (format: gb_sk_...)
2

Set up your project

Create a new directory for your trading bot:
Create a .env file to store your API key:
Never commit your API key to version control. Add .env to your .gitignore.
3

Configure Cursor rules

Create .cursor/rules.md in your project root to teach Cursor about Gigabrain API patterns:

Example: Funding Rate Monitor Bot

Build a bot that monitors funding rates and alerts when they reach extreme levels.
funding_monitor.py

Using Cursor Composer

Cursor’s Composer feature is perfect for building complex trading bots with Gigabrain. Here’s how to use it effectively:

Example Prompt for Composer

Cursor will use your .cursor/rules.md to generate code that follows Gigabrain API best practices.

Common Integration Patterns

Pattern 1: Structured Data Queries

Always specify exact fields for consistent responses:

Pattern 2: Error Handling

Implement retry logic for transient errors:

Pattern 3: Rate Limit Monitoring

Track your API usage:

Next Steps

Brain API Overview

Explore all available data types and query patterns

REST API Reference

Complete API documentation with authentication and endpoints

SuperAgent Setup

Launch an always-on SuperAgent on Gigabrain

Integrations

Connect Hyperliquid for trade execution
Gigabrain provides market intelligence tools, not financial advice. Always implement proper risk management in your trading bots. See the Risk Disclosure.