> For the complete documentation index, see [llms.txt](https://guide.moontrader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.moontrader.com/nachalo-raboty/rabota-s-birzhei/poluchenie-api-klyuchei-dlya-torgovli/poluchenie-api-klyuchei-dlya-bybit.md).

# Получение API ключей для Bybit

{% hint style="warning" %}
Перед созданием ключей должна быть настроена двухфакторная аутентификация Google Authenticator.
{% endhint %}

#### Основной аккаунт

1. Войдите в аккаунт Bybit
2. Перейдите в раздел API

   <figure><img src="/files/BgeraiMAelRSk1uOcfsc" alt=""><figcaption></figcaption></figure>
3. Нажмите «Создать новый ключ»
4. Выберите тип: «API-ключи, созданные системой»

   <figure><img src="/files/XvzCSzkSO2VgUCnZsA4O" alt=""><figcaption></figcaption></figure>

#### Настройка параметров

1. В поле «Название API-ключа» введите название (например, «MoonTrader»<br>

   <figure><img src="/files/S83XNFA7td2PTJy0glSB" alt=""><figcaption></figcaption></figure>
2. Установите следующие параметры:
   * Чтение и запись
   * Единый торговый аккаунт:
     * Ордера
     * Позиции
     * Торговля деривативами USDC
     * Торговать<br>

       <figure><img src="/files/LofFK5LLzb5Wg2Py36pv" alt=""><figcaption></figcaption></figure>

#### Настройка белого списка IP

При создании API-ключей рекомендуется указать список разрешённых IP-адресов. Только устройства с указанными IP смогут использовать ключ — это защищает от несанкционированного доступа, даже если злоумышленник получит ваши ключи.

**Какие IP указывать:**

* IP сервера с ядром MoonTrader — откуда отправляются торговые запросы
* IP сервера с Watchdog — если используете систему мониторинга для нескольких аккаунтов

**Настройка:**

1. Выберите «Доступ к OpenAPI есть только у IP со специальным разрешением»
2. Добавьте внешний статический IP вашего сервера с ядром MoonTrader
3. Если используете Watchdog на отдельном сервере — добавьте также его IP<br>

   <figure><img src="/files/LTxMapeZU3UiOvy3BgUm" alt=""><figcaption></figcaption></figure>

#### Сохранение ключей

Сохраните **API Secret** — он отображается только один раз.<br>

<figure><img src="/files/uSBdyes78ByziYOriSbI" alt=""><figcaption></figcaption></figure>

#### Создание ключей для субаккаунтов

1. В интерфейсе переключитесь на нужный субаккаунт

   <figure><img src="/files/U2D9W6zilmeaVo0kFP5F" alt=""><figcaption></figcaption></figure>
2. Перейдите в раздел управления API субаккаунта

   <figure><img src="/files/3LSIJl2DyGA0CqTlQfUc" alt=""><figcaption></figcaption></figure>
3. Повторите процедуру создания ключа


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://guide.moontrader.com/nachalo-raboty/rabota-s-birzhei/poluchenie-api-klyuchei-dlya-torgovli/poluchenie-api-klyuchei-dlya-bybit.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
