Otto AI · Trade Perpetuals

by Otto AI

POSTBase

$0.01

per call · USD Coin on Base

Open leveraged perpetual positions on Hyperliquid with optional native TP/SL trigger orders. Min notional $10. Max leverage varies by asset (BTC 40x, ETH 25x, SOL 20x). Supports BTC, ETH, SOL, and 100+ other markets.

Endpoint

POST https://x402.ottoai.services/trade-perpetuals

3

Calls / 30d

2

Unique payers / 30d

Aug 28

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://x402.ottoai.services/trade-perpetuals", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "asset": "BTC",
    "leverage": 25,
    "side": "long",
    "size": 250,
    "stopLoss": {
      "price": 60000
    },
    "takeProfit": {
      "price": 75000
    }
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://x402.ottoai.services/trade-perpetuals" \
  -H "Content-Type: application/json" \
  -d '{"asset":"BTC","leverage":25,"side":"long","size":250,"stopLoss":{"price":60000},"takeProfit":{"price":75000}}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "action_required": true,
  "asset": "BTC",
  "entry": {
    "amountConfirmed": true,
    "entryPrice": 67000,
    "filledSize": 0.0037,
    "leverage": 25,
    "marginMode": "cross",
    "orderId": "12345",
    "orderType": "market",
    "outcome": "filled",
    "positionOpen": true,
    "requestedNotional": 250,
    "requestedSizeInContracts": 0.0037,
    "side": "long",
    "size": 250,
    "sizeInContracts": 0.0037
  },
  "entryPrice": 67000,
  "message": "Your long position in BTC is open at 25x for 250 (0.0037 contracts), and the stop-loss could not be confirmed either way. Nothing was changed or cancelled on your behalf — add or confirm the trigger with /modify-hl-order before relying on it.",
  "orderId": "12345",
  "protection": {
    "actionRequired": true,
    "failed": [],
    "filled": [],
    "legs": [
      {
        "leg": "takeProfit",
        "orderId": "12346",
        "state": "resting"
      },
      {
        "detail": "The venue did not confirm this order and its current order list could not be read.",
        "leg": "stopLoss",
        "state": "unknown"
      }
    ],
    "placed": [
      "takeProfit"
    ],
    "requested": [
      "takeProfit",
      "stopLoss"
    ],
    "unknown": [
      "stopLoss"
    ]
  },
  "side": "long",
  "status": "partial",
  "tpOrderId": "12346"
}

Payment details

Pay to0x5bb4b0c766e0d5d791d9403fc275c22064709f68
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of Market Data and the homepage with a featured placement.

Get featured →

More from Otto AI & similar services