# Sub API Interface (Broker)

{% hint style="danger" %}
This section is under construction. Some functions may not work correctly.
{% endhint %}

## Create Sub ApiKey

{% hint style="info" %}
Please refer to the official Bitget API Docs for the required parameters.

[https://bitgetlimited.github.io/apidoc/en/broker/#create-sub-apikey-only-broker](https://bitgetlimited.github.io/apidoc/en/broker/#create-sub-apikey-only-broker)
{% endhint %}

#### Function name:

```javascript
createSubApiKeyBrokerOnly()
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

async function createSubApiKeyBrokerOnly(exchange) {
    try {
        let result = await exchange.createSubApiKeyBrokerOnly();
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await createSubApiKeyBrokerOnly(myBitgetAccount
```

## Get Sub ApiKey List

{% hint style="info" %}
Please refer to the official Bitget API Docs for the required parameters.

[https://bitgetlimited.github.io/apidoc/en/broker/#get-sub-apikey-list](https://bitgetlimited.github.io/apidoc/en/broker/#get-sub-apikey-list)
{% endhint %}

#### Function name:

```javascript
getSubApiKeyList()
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

async function getSubApiKeyList(exchange) {
    try {
        let result = await exchange.getSubApiKeyList();
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getSubApiKeyList(myBitgetAccount
```

## Modify Sub ApiKey

{% hint style="info" %}
Please refer to the official Bitget API Docs for the required parameters.

[https://bitgetlimited.github.io/apidoc/en/broker/#modify-sub-apikey-only-broker](https://bitgetlimited.github.io/apidoc/en/broker/#modify-sub-apikey-only-broker)
{% endhint %}

#### Function name:

```javascript
modifySubApiKeyBrokerOnly()
```

#### Usage:&#x20;

```javascript
import { createExchange } from "./exchanges/exchange.js";

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

async function modifySubApiKeyBrokerOnly(exchange) {
    try {
        let result = await exchange.modifySubApiKeyBrokerOnly();
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await modifySubApiKeyBrokerOnly(myBitgetAccount
```
