# 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>
{% 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>
{% 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>
{% 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.compendium.finance/pendax/using-pendax-sdk/bitget-functions/sub-api-interface-broker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
