Account REST API (0.0.1)

Welcome to the Hibachi.xyz Account API - your gateway to building powerful crypto trading tools on top of our platform. Whether you want to automate strategies, access account data, or analyze market activity, our API gives you the access you need.


To use the Hibachi.xyz API, you'll need a few credentials:

  • API Key
    Your API key is used to authenticate requests. You can generate and manage your API keys from your Account Settings.

  • Account ID
    This unique identifier represents your trading account and is required for authenticated API operations. You can find your Account ID in the same account settings page.

⚠️ Note: All endpoints under the Account and Trade API sections require authentication using your API key and account ID.

Download OpenAPI description
Overview
License

Languages
Servers
Production server

https://api.hibachi.xyz/

Capital

With the Capital endpoints manage your trading account, monitor and manage your portfolio including:

  • Balances
  • Positions
  • Transaction history
  • General account settings
Operations

Trade

Use the Trade endpoint to programmatically control your trades:

  • Submit new orders
  • Cancel existing ones
  • Track open orders and execution history
Operations

Account Info

Request

Get account information/details

Key Response Fields

  • balance (net equity) and maximalWithdraw
  • (collateral) assets
  • positions
  • risk related summary: totalOrderNotional, totalPositionNotional, totalUnrealizedPnl
  • The entryNotional in positions is: entry price multiply by quantity.
  • totalOrderNotional does not count orders that will reduce your position.
Security
api_key
Query
accountIdinteger(int64)(AccountId)>= 0required

You MUST make one Deposit to your account. Your Account ID will not be generated until your first deposit; this ID is required for a lot of endpoints Account ID: you will see ID: XXX below your API Key Name For more information see Pre-requisites

Example: accountId=140
curl -i -X GET \
  'https://api.hibachi.xyz/trade/account/info?accountId=140' \
  -H 'Authorization: YOUR_API_KEY_HERE'

Responses

Trade Account Info

Bodyapplication/json
assetsArray of objects(Asset)required

collateral

quantitystringrequired
Example: "13.130626"
symbolstringrequired
Example: "USDT"
balancestringrequired

net equity of the account

Example: "14.186087"
maximalWithdrawstringrequired

maximum amount that can be withdrawn from the account

Example: "4.152340"
numFreeTransfersRemaininginteger(int64)>= 0required
Example: 96
positionsArray of objects(Position)required
directionstring(Direction)required
Enum"Short""Long"
entryNotionalstringrequired

entry price multiply by quantity.

Example: "10.302213"
markPricestring or null
Example: "1234.5678"
notionalValuestringrequired
Example: "10.225008"
openPricestringrequired
Example: "1234.5678"
quantitystringrequired
Example: "0.004310550"
symbolstringrequired
Example: "ETH/USDT-P"
unrealizedFundingPnlstringrequired
Example: "0.077204"
unrealizedTradingPnlstringrequired
Example: "0.000000"
totalOrderNotionalstringrequired

does not count orders that will reduce your position.

Example: "8.670066"
totalPositionNotionalstringrequired
Example: "14.246782"
totalUnrealizedFundingPnlstringrequired
Example: "0.000000"
totalUnrealizedPnlstringrequired
Example: "0.055460"
totalUnrealizedTradingPnlstringrequired
Example: "0.055460"
tradeMakerFeeRatestring or null
Example: null
tradeTakerFeeRatestring or null
Example: null
Response
application/json
{ "assets": [ {} ], "balance": "14.186087", "maximalWithdraw": "4.152340", "numFreeTransfersRemaining": 96, "positions": [ {} ], "totalOrderNotional": "8.670066", "totalPositionNotional": "14.246782", "totalUnrealizedFundingPnl": "0.000000", "totalUnrealizedPnl": "0.055460", "totalUnrealizedTradingPnl": "0.055460", "tradeMakerFeeRate": null, "tradeTakerFeeRate": null }

Account Trades

Request

Get the trades history of your account.

It will return most recent up to 100 records.

Optional Query Parameter

  • page: this is optional, if not supply, it will default to 0 and return 100 trades. If suppy 100 trades in each page
Security
api_key
Query
accountIdinteger(int64)(AccountId)>= 0required

You MUST make one Deposit to your account. Your Account ID will not be generated until your first deposit; this ID is required for a lot of endpoints Account ID: you will see ID: XXX below your API Key Name For more information see Pre-requisites

Example: accountId=140
pageinteger(int32)>= 0

this is optional, if not supply, it will default to 0 and return 100 trades. If suppy 100 trades in each page

Example: page=0
curl -i -X GET \
  'https://api.hibachi.xyz/trade/account/trades?accountId=140&page=0' \
  -H 'Authorization: YOUR_API_KEY_HERE'

Responses

Trades

Bodyapplication/json
tradesArray of objects(Trade)required
askAccountIdinteger(int64)(u64)>= 0required
askOrderIdnull or u64 (integer)
One of:
null
bidAccountIdinteger(int64)(u64)>= 0required
bidOrderIdnull or u64 (integer)
One of:
null
feestringrequired
idinteger(int64)>= 0required
orderTypestring or null
pricestringrequired
quantitystringrequired
realizedPnlstringrequired
sidestring(Side)required
Enum"ASK""BID"
symbolstringrequired
timestampinteger(int64)>= 0required
Response
application/json
{ "trades": [ {} ] }

Settlements History

Request

This endpoint returns history of funding events.

Security
api_key
Query
accountIdinteger(int64)(AccountId)>= 0required

You MUST make one Deposit to your account. Your Account ID will not be generated until your first deposit; this ID is required for a lot of endpoints Account ID: you will see ID: XXX below your API Key Name For more information see Pre-requisites

Example: accountId=140
curl -i -X GET \
  'https://api.hibachi.xyz/trade/account/settlements_history?accountId=140' \
  -H 'Authorization: YOUR_API_KEY_HERE'

Responses

Account Settlements History

Bodyapplication/json
settlementsArray of objects(SettlementHistory)required
directionstring(Direction)required
Enum"Short""Long"
indexPricestringrequired
quantitystringrequired
settledAmountstringrequired
symbolstringrequired
timestampinteger(int64)>= 0required
Response
application/json
{ "settlements": [ {} ] }

Get Order

Request

Get the details about your one particular order.

Security
api_key
Query
orderIdVariantnonce (object) or orderId (object)(OrderIdVariant)required

Provide either a nonce or an order ID, but not both.

One of:

Provide either a nonce or an order ID, but not both.

nonceinteger(int64)>= 0required

Should be the `nonce`` used when creating the order.

accountIdinteger(int64)(AccountId)>= 0required

You MUST make one Deposit to your account. Your Account ID will not be generated until your first deposit; this ID is required for a lot of endpoints Account ID: you will see ID: XXX below your API Key Name For more information see Pre-requisites

Example: accountId=140
curl -i -X GET \
  'https://api.hibachi.xyz/trade/order?accountId=140&nonce=0' \
  -H 'Authorization: YOUR_API_KEY_HERE'

Responses

Bodyapplication/json
accountIdinteger(int64)>= 0required
Example: 10
availableQuantitystringrequired
Example: "0.389560448"
contractIdinteger(int32)>= 0required
Example: 1
creationTimeinteger or null(int64)>= 0
Example: 1748632398977
finishTimeinteger or null(int64)>= 0
Example: 1748632398977
numOrdersRemaininginteger or null(int64)>= 0
numOrdersTotalinteger or null(int64)>= 0
orderIdinteger(int32)>= 0required
Example: 1234
orderTypestring(OrderTypeInfo)required
Enum"LIMIT""MARKET"
pricestring or null
Example: "3500.01"
sidestring(Side)required
Enum"ASK""BID"
statusstring(OrderState)required
Enum"PENDING""SCHEDULED_TWAP""PLACED""REJECTED""CANCELLED""PARTIALLY_FILLED""FILLED"
symbolstringrequired
Example: "ETH/USDT-P"
totalQuantitystringrequired
Example: "0.389560448"
triggerPricestring or null
Example: "1234.5432"
Response
application/json
{ "accountId": 10, "availableQuantity": "0.389560448", "contractId": 1, "creationTime": 1748632398977, "finishTime": 1748632398977, "numOrdersRemaining": 0, "numOrdersTotal": 0, "orderId": 1234, "orderType": "LIMIT", "price": "3500.01", "side": "ASK", "status": "PENDING", "symbol": "ETH/USDT-P", "totalQuantity": "0.389560448", "triggerPrice": "1234.5432" }

Modify Order

Request

Modify an existing order.

Notes

  • ⚠️ You cannot modify an order that has been partially matched.
  • You can only update quantity and price. The symbol must remain the same.
  • A new unique nonce timestamp (same as if you were placing a new order).
Security
api_key
Bodyapplication/jsonrequired
One of:

the order_id returned by /trade/order or /trade/orders API. (Currently we do not support using nonce as an identifier for modification. We are working on a new Client-ID feature to enable this.)

nonceinteger(int64)>= 0required

A new unique nonce timestamp (same as if you were placing a new order).

accountIdinteger(int64)(AccountID)>= 0required

You MUST make one Deposit to your account. Your Account ID will not be generated until your first deposit; this ID is required for a lot of endpoints Account ID: you will see ID: XXX below your API Key Name For more information see Pre-requisites

maxFeesPercentstring or nullrequired

should be at least the returned value of /marketapi/market/exchange-info endpoint. Otherwise, it will be rejected.

Example: "0.00045"
signaturestring(SignatureDoc)required

SIGNATURE IS REQUIRED! Use signature field (65 bytes) to sign the message. Refer to the Signing section for more context.

updatedPricestring or nullrequired

You can only update quantity and price. The symbol must remain the same.

Example: "3500.1"
updatedQuantitystringrequired

You can only update quantity and price. The symbol must remain the same.

Example: "0.1"
updatedTriggerPricestring or null

You can only update quantity and price. The symbol must remain the same.

Example: "3500.1"
curl -i -X PUT \
  https://api.hibachi.xyz/trade/order \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "nonce": 0,
    "accountId": 140,
    "maxFeesPercent": "0.00045",
    "signature": "0000000000000000000000000000000000000000000000000000000000000000",
    "updatedPrice": "3500.1",
    "updatedQuantity": "0.1",
    "updatedTriggerPrice": "3500.1"
  }'

Responses

Bodyapplication/json
object(ModifyOrderResult)
Response
application/json
{}

Create Order

Request

Submit a new order.

In the response, it will return the order id for this new order.

Security
api_key
Bodyapplication/jsonrequired

New order data

accountIdinteger(int64)(AccountID)>= 0required

You MUST make one Deposit to your account. Your Account ID will not be generated until your first deposit; this ID is required for a lot of endpoints Account ID: you will see ID: XXX below your API Key Name For more information see Pre-requisites

creationDeadlinestring or null

optional

maxFeesPercentstring or nullrequired

should be at least the returned value of /market/exchange-info endpoint. Otherwise, it will be rejected.

nonceinteger(int64)>= 0required

should be a unix timestamp either ms or us unique to this order

orderFlagsnull or OrderFlags (string)
One of:
null
orderTypestring(ApiOrderType)required
Enum"LIMIT""MARKET"
pricestring or nullrequired
quantitystringrequired
sidestring(Side)required
Enum"ASK""BID"
signaturestring(SignatureDoc)required

SIGNATURE IS REQUIRED! Use signature field (65 bytes) to sign the message. Refer to the Signing section for more context.

symbolstringrequired

should be one of the symbol from one of the futureContracts returned by /marketapi/market/exchange-info API

triggerPricestring or null

optional

twapConfignull or TWAPConfig (object)
One of:
null
curl -i -X POST \
  https://api.hibachi.xyz/trade/order \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "accountId": 140,
    "creationDeadline": "string",
    "maxFeesPercent": "string",
    "nonce": 0,
    "orderFlags": {},
    "orderType": "LIMIT",
    "price": "string",
    "quantity": "string",
    "side": "ASK",
    "signature": "0000000000000000000000000000000000000000000000000000000000000000",
    "symbol": "string",
    "triggerPrice": "string",
    "twapConfig": {}
  }'

Responses

Trade Order Create Response

Bodyapplication/json
orderIdinteger(int64)(u64)>= 0required
Response
application/json
{ "orderId": 0 }

Delete Order

Request

Remove an existing order.

Signing

Include the following fields when creating the signature:

  • accountId
  • orderId OR nonce
Security
api_key
Bodyapplication/jsonrequired
One of:

Provide either a nonce or an order ID, but not both.

nonceinteger(int64)>= 0required

Should be the `nonce`` used when creating the order.

accountIdinteger(int64)(AccountID)>= 0required

You MUST make one Deposit to your account. Your Account ID will not be generated until your first deposit; this ID is required for a lot of endpoints Account ID: you will see ID: XXX below your API Key Name For more information see Pre-requisites

signaturestring(SignatureDoc)required

SIGNATURE IS REQUIRED! Use signature field (65 bytes) to sign the message. Refer to the Signing section for more context.

curl -i -X DELETE \
  https://api.hibachi.xyz/trade/order \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "nonce": 0,
    "accountId": 140,
    "signature": "0000000000000000000000000000000000000000000000000000000000000000"
  }'

Responses

Trade Order Delete Response

Get Orders

Request

Get the pending orders of your account.

Security
api_key
Query
accountIdinteger(int64)(AccountId)>= 0required

You MUST make one Deposit to your account. Your Account ID will not be generated until your first deposit; this ID is required for a lot of endpoints Account ID: you will see ID: XXX below your API Key Name For more information see Pre-requisites

Example: accountId=140
curl -i -X GET \
  'https://api.hibachi.xyz/trade/orders?accountId=140' \
  -H 'Authorization: YOUR_API_KEY_HERE'

Responses

Bodyapplication/jsonArray [
accountIdinteger(int64)>= 0required
Example: 10
availableQuantitystringrequired
Example: "0.389560448"
contractIdinteger(int32)>= 0required
Example: 1
creationTimeinteger or null(int64)>= 0
Example: 1748632398977
finishTimeinteger or null(int64)>= 0
Example: 1748632398977
numOrdersRemaininginteger or null(int64)>= 0
numOrdersTotalinteger or null(int64)>= 0
orderIdinteger(int32)>= 0required
Example: 1234
orderTypestring(OrderTypeInfo)required
Enum"LIMIT""MARKET"
pricestring or null
Example: "3500.01"
sidestring(Side)required
Enum"ASK""BID"
statusstring(OrderState)required
Enum"PENDING""SCHEDULED_TWAP""PLACED""REJECTED""CANCELLED""PARTIALLY_FILLED""FILLED"
symbolstringrequired
Example: "ETH/USDT-P"
totalQuantitystringrequired
Example: "0.389560448"
triggerPricestring or null
Example: "1234.5432"
]
Response
application/json
[ { "accountId": 10, "availableQuantity": "0.389560448", "contractId": 1, "creationTime": 1748632398977, "finishTime": 1748632398977, "numOrdersRemaining": 0, "numOrdersTotal": 0, "orderId": 1234, "orderType": "LIMIT", "price": "3500.01", "side": "ASK", "status": "PENDING", "symbol": "ETH/USDT-P", "totalQuantity": "0.389560448", "triggerPrice": "1234.5432" } ]

Batch Orders

Request

Submit multiple new order requests for an account. Supports place, and modify.

The format is identical to POST /trade/order the only differences are:

  • accountId is specified in the top-level only once rather than for each order
  • each order element needs to have an action field which can be either place or modify

It will return a list of responses – one for each order in the input.

Security
api_key
Bodyapplication/jsonrequired
accountIdinteger(int64)(AccountID)>= 0required

You MUST make one Deposit to your account. Your Account ID will not be generated until your first deposit; this ID is required for a lot of endpoints Account ID: you will see ID: XXX below your API Key Name For more information see Pre-requisites

ordersArray of objects(OrderBatchPlace)required
actionstring(BatchAction)required
Enum"place""modify""cancel"
contractIdinteger(int32)>= 0required
Example: 1
creationDeadlinestring or null

optional

maxFeesPercentstring or nullrequired

should be at least the returned value of /market/exchange-info endpoint. Otherwise, it will be rejected.

nonceinteger or null(int64)>= 0

should be a unix timestamp either ms or us unique to this order

Example: 1748632398977
orderFlagsnull or OrderFlags (string)
One of:
null
orderTypestring(OrderTypeInfo)required
Enum"LIMIT""MARKET"
pricestring or null
Example: "3500.01"
quantitystringrequired
Example: "5.0000"
sidestring(Side)required
Enum"ASK""BID"
signaturestring(SignatureDoc)required

SIGNATURE IS REQUIRED! Use signature field (65 bytes) to sign the message. Refer to the Signing section for more context.

symbolstringrequired

should be one of the symbol from one of the futureContracts returned by /market/exchange-info API

Example: "ETH/USDT-P"
triggerPricestring or null

optional

Example: "1234.5432"
curl -i -X POST \
  https://api.hibachi.xyz/trade/orders \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "accountId": 140,
    "orders": [
      {
        "action": "place",
        "contractId": 1,
        "creationDeadline": "string",
        "maxFeesPercent": "string",
        "nonce": 1748632398977,
        "orderFlags": {},
        "orderType": "LIMIT",
        "price": "3500.01",
        "quantity": "5.0000",
        "side": "ASK",
        "signature": "0000000000000000000000000000000000000000000000000000000000000000",
        "symbol": "ETH/USDT-P",
        "triggerPrice": "1234.5432"
      }
    ]
  }'

Responses

Trade Order Delete Response

Bodyapplication/json
ordersArray of objects(OrderCreateModifyResult)required
nonceinteger or null(int64)>= 0

Unique identifier for the transaction. Either nonce OR order_id must be provided, but not both.

orderIdnull or u64 (integer)
One of:
null
Response
application/json
{ "orders": [ {} ] }

Delete Orders

Request

Allows you to batch cancel all open orders for an account.

Security
api_key
Bodyapplication/jsonrequired
accountIdinteger(int32)>= 0required
Example: 10
nonceinteger(int64)>= 0required
Example: 17147016
signaturestring(SignatureDoc)required

SIGNATURE IS REQUIRED! Use signature field (65 bytes) to sign the message. Refer to the Signing section for more context.

curl -i -X DELETE \
  https://api.hibachi.xyz/trade/orders \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "accountId": 10,
    "nonce": 17147016,
    "signature": "0000000000000000000000000000000000000000000000000000000000000000"
  }'

Responses

Bodyapplication/json
statusstring(Status)required
Enum"success""failed"
Response
application/json
{ "status": "success" }