{"slug":"chainhilt-ai-api-v1-perp-hyperliquid-leverage-preview-9cf779","title":"Set cross or isolated leverage for a perp asset","host":"chainhilt.ai","method":"POST","resource":"https://chainhilt.ai/api/v1/perp/hyperliquid/leverage/preview","category":"code","description":"Set cross or isolated leverage for a perp asset. Supply isCross and positive integer leverage; market limits apply. Sign the L1 preview and submit it unchanged to the returned submitPath (unpaid). Errors: 400 invalid input; execution may return 422 exchange rejection or 502 provider failure. Treat s","price_listed":0.001,"price_asked":null,"state":"effects","state_label":"Not tested: has real-world effects","checks_7d":0,"answered_7d":0,"latency_ms_median":null,"reported_calls_30d":24,"reported_payers_30d":5,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"action":{"asset":0,"isCross":true,"leverage":5,"type":"updateLeverage"},"nonce":1710000000000},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"accountAddress":{"description":"Signing account's address, returned as response metadata; not part of the signed action.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"action":{"additionalProperties":false,"description":"Leverage update action.","properties":{"asset":{"description":"Perp asset ID","minimum":0,"type":"integer"},"isCross":{"description":"true for cross margin, false for isolated.","type":"boolean"},"leverage":{"description":"Integer leverage; market limits apply","exclusiveMinimum":0,"type":"integer"},"type":{"const":"updateLeverage","description":"Always \"updateLeverage\".","type":"string"}},"required":["type","asset","isCross","leverage"],"type":"object"},"expiresAfter":{"description":"Millisecond timestamp after which Hyperliquid rejects the action. Signed with the action.","minimum":0,"type":"integer"},"nonce":{"description":"Action nonce in milliseconds since the epoch; defaults to the current time.","minimum":0,"type":"integer"},"vaultAddress":{"description":"Vault or subaccount to act for; omit to act for the signer. Signed with the action.","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"required":["action"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[],"description_full":"Set cross or isolated leverage for a perp asset. Supply isCross and positive integer leverage; market limits apply. Sign the L1 preview and submit it unchanged to the returned submitPath (unpaid). Errors: 400 invalid input; execution may return 422 exchange rejection or 502 provider failure. Treat spot and perp as one balance only when the account abstraction mode is \"unifiedAccount\".","last_updated":"2026-11-23T09:13:34.535Z","schemes":["exact"]}