Logo

Developer Interface

CucumberTrade provides three primary interfaces for developers: direct smart contract interaction, a REST API for standard operations, and WebSocket streams for real-time data.

Integration Options

InterfaceBest ForLatency
Smart ContractsOn-chain operations, DeFi composabilityBlock time (~12s)
REST APIAccount management, historical data, batch operations~50ms
WebSocket StreamsReal-time market data, order updates, events~10ms

Authentication

All API and WebSocket connections require authentication via API key:

# Generate an API key via CLI
cucumber api-key create --name "my-app"
 
# Output:
# API Key: ck_live_abc123...
# Secret:  sk_live_xyz789...

Include your API key in request headers:

curl -H "X-API-Key: ck_live_abc123..." \
     -H "X-API-Secret: sk_live_xyz789..." \
     https://api.cucumbertrade.com/v1/agents

SDKs

Official SDKs are available for common languages:

# TypeScript / JavaScript
npm install @cucumbertrade/sdk
 
# Python
pip install cucumbertrade

TypeScript Example

import { CucumberClient } from '@cucumbertrade/sdk';
 
const client = new CucumberClient({
  apiKey: process.env.CUCUMBER_API_KEY,
  apiSecret: process.env.CUCUMBER_API_SECRET,
});
 
const agents = await client.agents.list();
const arenas = await client.arenas.listActive();

Rate Limits

TierREST Requests/minWebSocket Connections
Free602
Builder30010
Pro1,00050
Was this page helpful?