API referenceInstance API
GUIDE & REFERENCE

Spiking Networks

Every registered spiking networks instance operation, with source-derived inputs, outputs, access policy, and errors.

This reference covers 16 HTTP operations registered by the Akasha daemon. Call these paths on your instance base URL. See authentication, errors, and coverage before integrating.

MethodPathOperation
POST/v1/snn/network/buildSnn build
POST/v1/snn/network/compileSnn compile
POST/v1/snn/network/stepSnn step
POST/v1/snn/train/bpttSnn train bptt
POST/v1/snn/network/stateSnn state
POST/v1/snn/federation/registerSnn federation register
POST/v1/snn/federation/contributeSnn federation contribute
POST/v1/snn/federation/parametersSnn federation parameters
POST/v1/snn/federation/spikeSnn federation spike
POST/v1/snn/federation/capabilitiesSnn federation capabilities
POST/v1/snn/federation/agent/updateSnn federation agent update
POST/v1/snn/federation/agent/removeSnn federation agent remove
POST/v1/snn/federation/spikesSnn federation spikes recent
GET/v1/snn/healthSnn health
GET/v1/snn/statsSnn stats
POST/v1/snn/neuronsSnn neurons

POST /v1/snn/network/build

Snn build

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped( CoreAction::Write, "snn:write", request_authority::MEMORY_SNN, ); require_scoped( CoreAction::Admin, "snn:admin", request_authority::MEMORY_SNN, ); require_matching_db(&scoped_db).

Request

JsonSnnBuildReq

FieldRust typeRequired on inputNotes
network_idOption<String>No; optional or defaulted
namespaceOption<String>No; optional or defaulted
versionOption<String>No; optional or defaulted
specOption<serde_json::Value>No; optional or defaulted
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: flatten
struct SnnBuildReq {
    network_id: Option<String>,
    namespace: Option<String>,
    version: Option<String>,
    spec: Option<serde_json::Value>,
    #[serde(flatten)]
    body_authority: RejectedBodyAuthority,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

response

Errors and validation

Directly referenced error variants: Forbidden, InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:8975. Registration: akasha-daemon/src/main.rs:4463.

POST /v1/snn/network/compile

Snn compile

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped( CoreAction::Write, "snn:write", request_authority::MEMORY_SNN, ); require_scoped( CoreAction::Query, "snn:execute", request_authority::MEMORY_SNN, ); require_matching_db(&scoped_db).

Request

JsonSnnCompileReq

FieldRust typeRequired on inputNotes
network_idStringYes
namespaceStringYes
versionOption<String>No; optional or defaulted
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: flatten
struct SnnCompileReq {
    network_id: String,
    namespace: String,
    version: Option<String>,
    #[serde(flatten)]
    body_authority: RejectedBodyAuthority,
}

JSON field accesses in handler: input, output, spec. Nested lookups are included; this list alone does not establish requiredness.

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

SnnCompileResponse {
        compiled_id: req.network_id.clone(),
        version: version.clone(),
    }

Errors and validation

Directly referenced error variants: Forbidden, Internal, InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9050. Registration: akasha-daemon/src/main.rs:4464.

POST /v1/snn/network/step

Snn step

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped( CoreAction::Query, "snn:execute", request_authority::MEMORY_SNN, ); require_matching_db(&scoped).

Request

JsonSnnStepReq

FieldRust typeRequired on inputNotes
network_idStringYes
namespaceStringYes
versionOption<String>No; optional or defaulted
inputVec<f32>Yes
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: flatten
struct SnnStepReq {
    network_id: String,
    namespace: String,
    version: Option<String>,
    input: Vec<f32>,
    #[serde(flatten)]
    body_authority: RejectedBodyAuthority,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

SnnStepResponse { output: result_vec }

Errors and validation

Directly referenced error variants: Forbidden, Internal. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9166. Registration: akasha-daemon/src/main.rs:4465.

POST /v1/snn/train/bptt

Snn train bptt

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped( CoreAction::Write, "snn:train", request_authority::MEMORY_SNN, ); require_matching_db(&scoped_db).

Request

Implementation limit: Placeholder training: constructs a trainer but does not run BPTT. Records placeholder completed metrics and saves a versioned spec; do not interpret success as learned weights.

JsonSnnTrainBpttReq

FieldRust typeRequired on inputNotes
network_idStringYes
namespaceStringYes
versionOption<String>No; optional or defaulted
stepsusizeYes
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: flatten
struct SnnTrainBpttReq {
    network_id: String,
    namespace: String,
    version: Option<String>,
    steps: usize,
    #[serde(flatten)]
    body_authority: RejectedBodyAuthority,
}

JSON field accesses in handler: spec. Nested lookups are included; this list alone does not establish requiredness.

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

SnnTrainBpttResponse {
        network_id: req.network_id,
        version,
    }

Errors and validation

Directly referenced error variants: Forbidden, Internal, InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9210. Registration: akasha-daemon/src/main.rs:4466.

POST /v1/snn/network/state

Snn state

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped(CoreAction::Read, "snn:read", request_authority::MEMORY_SNN); require_matching_db(&scoped_db).

Request

JsonSnnStateReq

FieldRust typeRequired on inputNotes
namespaceStringYes
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: flatten
struct SnnStateReq {
    namespace: String,
    #[serde(flatten)]
    body_authority: RejectedBodyAuthority,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

SnnStateResponse {
        namespace: req.namespace,
        networks,
    }

Errors and validation

Directly referenced error variants: Forbidden. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9318. Registration: akasha-daemon/src/main.rs:4467.

POST /v1/snn/federation/register

Snn federation register

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

JsonSnnFederationRegisterReq

FieldRust typeRequired on inputNotes
tokenOption<String>No; optional or defaulted
agent_idStringYes
hostStringYes
capabilitiesVec<String>Yes
ensemblesVec<EnsembleInfo>No; optional or defaultedSerde: default
visibilityOption<String>No; optional or defaulted
trust_scoreOption<f32>No; optional or defaultedSerde: default
struct SnnFederationRegisterReq {
    token: Option<String>,
    agent_id: String,
    host: String,
    capabilities: Vec<String>,
    #[serde(default)]
    ensembles: Vec<EnsembleInfo>,
    visibility: Option<String>,
    #[serde(default)]
    trust_score: Option<f32>,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::json!({"ok": true})

Errors and validation

Directly referenced error variants: from. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9359. Registration: akasha-daemon/src/main.rs:4468.

POST /v1/snn/federation/contribute

Snn federation contribute

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

JsonSnnFederationContributeReq

FieldRust typeRequired on inputNotes
tokenOption<String>No; optional or defaulted
agent_idStringYes
deltasWeightDeltasYes
struct SnnFederationContributeReq {
    token: Option<String>,
    agent_id: String,
    deltas: WeightDeltas,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::to_value(snapshot).unwrap_or_default()

Errors and validation

Directly referenced error variants: from. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9380. Registration: akasha-daemon/src/main.rs:4469.

POST /v1/snn/federation/parameters

Snn federation parameters

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

JsonSnnFederationTokenReq

FieldRust typeRequired on inputNotes
tokenOption<String>No; optional or defaulted
struct SnnFederationTokenReq {
    token: Option<String>,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::to_value(snapshot).unwrap_or_default()

Errors and validation

Directly referenced error variants: from. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9392. Registration: akasha-daemon/src/main.rs:4473.

POST /v1/snn/federation/spike

Snn federation spike

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

JsonSnnFederationSpikeReq

FieldRust typeRequired on inputNotes
tokenOption<String>No; optional or defaulted
eventSpikeEventPayloadYes
struct SnnFederationSpikeReq {
    token: Option<String>,
    event: SpikeEventPayload,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::json!({"ok": true})

Errors and validation

Directly referenced error variants: from. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9404. Registration: akasha-daemon/src/main.rs:4477.

POST /v1/snn/federation/capabilities

Snn federation capabilities

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

JsonSnnFederationCapabilitiesReq

FieldRust typeRequired on inputNotes
tokenOption<String>No; optional or defaulted
requiredOption<Vec<String>>No; optional or defaultedSerde: default
struct SnnFederationCapabilitiesReq {
    token: Option<String>,
    #[serde(default)]
    required: Option<Vec<String>>,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::to_value(list).unwrap_or_default()

Errors and validation

Directly referenced error variants: from. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9416. Registration: akasha-daemon/src/main.rs:4478.

POST /v1/snn/federation/agent/update

Snn federation agent update

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

JsonSnnFederationAgentUpdateReq

FieldRust typeRequired on inputNotes
tokenOption<String>No; optional or defaulted
agent_idStringYes
visibilityOption<String>No; optional or defaulted
trust_scoreOption<f32>No; optional or defaulted
struct SnnFederationAgentUpdateReq {
    token: Option<String>,
    agent_id: String,
    visibility: Option<String>,
    trust_score: Option<f32>,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::to_value(updated).unwrap_or_default()

Errors and validation

Directly referenced error variants: from. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9429. Registration: akasha-daemon/src/main.rs:4482.

POST /v1/snn/federation/agent/remove

Snn federation agent remove

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

JsonSnnFederationAgentRemoveReq

FieldRust typeRequired on inputNotes
tokenOption<String>No; optional or defaulted
agent_idStringYes
struct SnnFederationAgentRemoveReq {
    token: Option<String>,
    agent_id: String,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::json!({"ok": true})

Errors and validation

Directly referenced error variants: from. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9446. Registration: akasha-daemon/src/main.rs:4486.

POST /v1/snn/federation/spikes

Snn federation spikes recent

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

JsonSnnFederationTokenReq

FieldRust typeRequired on inputNotes
tokenOption<String>No; optional or defaulted
struct SnnFederationTokenReq {
    token: Option<String>,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::to_value(list).unwrap_or_default()

Errors and validation

Directly referenced error variants: from. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:9458. Registration: akasha-daemon/src/main.rs:4490.

GET /v1/snn/health

Snn health

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.

Request

No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.

Response

Declared return: Result<impl IntoResponse, DaemonError>

Serialization is delegated or the handler returns a raw response. Consult the exact handler below; the OpenAPI response intentionally remains unconstrained.

Errors and validation

Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:10301. Registration: akasha-daemon/src/main.rs:4494.

GET /v1/snn/stats

Snn stats

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSNN

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped(CoreAction::Read, "snn:read", request_authority::MEMORY_SNN); require_matching_db(&db).

Request

No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::json!({
        "cacheHits": metrics.cache_hits.get(),
        "cacheMisses": metrics.cache_misses.get(),
        "cacheEvictions": metrics.cache_evictions.get(),
        "loadFailures": metrics.load_failures.get()
    })

Errors and validation

Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:11151. Registration: akasha-daemon/src/main.rs:4495.

POST /v1/snn/neurons

Snn neurons

AvailabilitySource contract
Registrationconfig.enable_snn
Runtime servicesnn
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped(CoreAction::Read, "snn:read", request_authority::MEMORY_SNN); require_matching_db(&db).

Request

JsonSnnNeuronsReq

FieldRust typeRequired on inputNotes
network_idStringYes
struct SnnNeuronsReq {
    network_id: String,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::json!({
        "networkId": req.network_id,
        "neurons": []
    })

Errors and validation

Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:11173. Registration: akasha-daemon/src/main.rs:4496.

On this page