> For the complete documentation index, see [llms.txt](https://docs.anthriq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anthriq.com/bxi-studio/developer/overview.md).

# SDK Reference

The BXI SDK gives programmatic control over Anthriq hardware and the BXI Studio backend. Use it to configure channels, seat a headset, verify electrode contact, stream EXG, and run processing pipelines without the BXI Studio interface.

The SDK ships as two packages. `@anthriq_dev/bxi-interface` talks to one device through the BXI interface bridge. `@anthriq_dev/services` talks to the backend services that run pipelines and handle recording. Both run in the same process: a typical acquisition application configures hardware and starts a stream with the first, then runs the pipeline that consumes it with the second.

## Install

{% tabs %}
{% tab title="Node.js" %}

```bash
npm install @anthriq_dev/bxi-interface
npm install @anthriq_dev/services
```

Both packages depend on the `zeromq` native bindings, which npm builds during install. `@anthriq_dev/bxi-interface` additionally depends on `protobufjs` for decoding stream frames.

Both are ES modules (`"type": "module"`). Import them with `import`, not `require`.
{% endtab %}

{% tab title="Python" %}

```bash
pip install anthriq-bxi-interface
pip install anthriq-services
```

{% endtab %}
{% endtabs %}

## Start here

Go to your device — each page carries its specifications, the features it declares, and a complete runnable setup sequence:

* [Anthriq Instinct](/bxi-studio/developer/overview/devices/instinct.md), the motorised headset
* [xSys](/bxi-studio/developer/overview/devices/xsys.md), the amplifier with externally wired electrodes
* [xBud](/bxi-studio/developer/overview/devices/xbud.md), USB analog acquisition through an NI DAQ

A feature that only one device has sits under that device: [Position the headset](/bxi-studio/developer/overview/devices/instinct/motors.md) under Instinct, [Acquire analog input](/bxi-studio/developer/overview/devices/xbud/analog-input.md) under xBud. The **Features** pages hold the mechanics that more than one device declares, written once. The **Concepts** pages explain the model underneath.

## Follow the session order

Pages are ordered the way a session runs:

1. [Install and connect](/bxi-studio/developer/overview/get-started/connect.md), then [Configure the client](/bxi-studio/developer/overview/get-started/configuration.md).
2. [Read device information](/bxi-studio/developer/overview/get-started/device-info.md) to learn what the connected device supports.
3. [Configure channels](/bxi-studio/developer/overview/features/channels.md) for gain, filtering, and routing.
4. [Position the headset](/bxi-studio/developer/overview/devices/instinct/motors.md).
5. [Measure contact impedance](/bxi-studio/developer/overview/features/impedance.md) to confirm the electrodes are seated.
6. [Stream EXG](/bxi-studio/developer/overview/features/exg.md), or [run parallel streams](/bxi-studio/developer/overview/features/parallel.md) to watch impedance while recording.

Impedance comes before EXG because that is the order it happens in: confirm contact, then acquire.

[Update firmware](/bxi-studio/developer/overview/features/firmware.md) sits outside that sequence; it is maintenance rather than part of a session. xBud follows its own path entirely, in [Acquire analog input](/bxi-studio/developer/overview/devices/xbud/analog-input.md).

## Read the concepts

Four pages describe behaviour that every task depends on. Reading them first makes the task pages shorter and the failure modes recognisable.

* [How the SDK talks to a device](/bxi-studio/developer/overview/concepts/architecture.md): the bridge daemon, the transport, and how capabilities are discovered rather than hardcoded.
* [Device support](/bxi-studio/developer/overview/concepts/device-support.md): which features each device declares.
* [Stream lifecycle](/bxi-studio/developer/overview/concepts/streams.md): the six steps every stream follows, and the frame formats.
* [Impedance measurement](/bxi-studio/developer/overview/concepts/impedance.md): what separates a raw magnitude from an impedance in ohms, and what each conversion needs.

## Run the backend services

`@anthriq_dev/services` covers everything that outlives a single device session:

* [Connect to the services](/bxi-studio/developer/overview/backend-services/connect.md) and [Run pipelines](/bxi-studio/developer/overview/backend-services/pipelines.md).
* [Manage operators and pipelines](/bxi-studio/developer/overview/backend-services/registries.md).
* [Record and play back](/bxi-studio/developer/overview/backend-services/recording.md), then [Read recording files](/bxi-studio/developer/overview/backend-services/recording-files.md) for the on-disk layout and the marker format.
