Exported Brain API
The Exported Brain API is a REST API embedded in the brain container of an exported Bonsai brain to support integration with real-world systems.
Tip
All Bonsai brain containers serve API details, including details of the custom
request and response objects, on localhost:
- NGN.1 brains: http://localhost:5000/v1/doc/index.html
- NGN.2 brains: http://localhost:5000/swagger.html
Brain container versions
Bonsai brains are packaged as containerized service during export. The resulting brain container can run anywhere Docker is installed. The container version for a given brain depends on when the brain was exported.
| Version | Doc label | Status | Supported functionality |
|---|---|---|---|
| 1.0 | NGN.1 | Retired 2021-07-07 | Single client, no memory, output concept only |
| 2.0 | NGN.2 | Current | Multi-client, memory, intermediate concept selection |
HTTP headers
The Brain API supports the following headers:
Content-Type
| Type | Use | Default |
|---|---|---|
| UTF-8 string | REQUIRED | None |
Indicates the format of the request sent to the container. Must be one of:
application/json
Accept
| Type | Use | Default |
|---|---|---|
| UTF-8 string | OPTIONAL | application/json |
Indicates the desired response format for the client. If you include multiple
Accept headers, one of provided values must be application/json or */*.