---
title: "Set Leverage"
method: POST
path: "/trading/{account_name}/{connector_name}/leverage"
tags: ["Trading"]
---

# Set Leverage

`POST /trading/{account_name}/{connector_name}/leverage`

Set leverage for a specific trading pair on a perpetual connector.

Args:
    account_name: Name of the account
    connector_name: Name of the perpetual connector
    request: Leverage request with trading pair and leverage value
    accounts_service: Injected accounts service

Returns:
    Dictionary with success status and message

Raises:
    HTTPException: 400 for invalid parameters or non-perpetual connector, 404 for account/connector not found, 500 for execution errors

## Path parameters

- `account_name` string, required
- `connector_name` string, required

## Request body

- LeverageRequest — Request model for setting leverage on perpetual connectors
  - `trading_pair` string, required — Trading pair (e.g., BTC-USDT)
  - `leverage` integer, required — Leverage value (typically 1-125)

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/hummingbot/apis/hummingbot-api.md) · [All operations](https://skmtc.net/hummingbot/apis/hummingbot-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hummingbot/hummingbot-api/versions/5347fe79537f/schema)
