Reference
API reference
Find an endpoint, inspect its fields, and handle its responses.
https://dydema--eegapi-gateway.modal.run. It lists the public routes only: Wizard’s /v1/task-models, and /v1/usage, /v1/status and /healthz.This page lists field names and types only. For what each request and response field means, read the Wizard, Dataset format and Signals & montages guides.
Account and status
/healthzGET /healthzRequest example
import os
import requests
response = requests.request(
"GET",
'https://dydema--eegapi-gateway.modal.run/healthz',
headers={"Authorization": f"Bearer {os.environ['DYDEMA_API_KEY']}"},
timeout=60,
)
print(response.status_code, response.text)// Node 22 or newer. Save as example.mjs and run: node example.mjs
const key = process.env.DYDEMA_API_KEY;
if (!key) throw new Error("set DYDEMA_API_KEY first");
const response = await fetch('https://dydema--eegapi-gateway.modal.run/healthz', {
method: "GET",
headers: { Authorization: `Bearer ${key}` },
signal: AbortSignal.timeout(60_000),
});
console.log(response.status, await response.text());curl -sS --request GET 'https://dydema--eegapi-gateway.modal.run/healthz' \
--header "Authorization: Bearer $DYDEMA_API_KEY"Set DYDEMA_API_KEY. Run the complete examples →
/v1/statusGET /v1/statusRequest example
import os
import requests
response = requests.request(
"GET",
'https://dydema--eegapi-gateway.modal.run/v1/status',
headers={"Authorization": f"Bearer {os.environ['DYDEMA_API_KEY']}"},
timeout=60,
)
print(response.status_code, response.text)// Node 22 or newer. Save as example.mjs and run: node example.mjs
const key = process.env.DYDEMA_API_KEY;
if (!key) throw new Error("set DYDEMA_API_KEY first");
const response = await fetch('https://dydema--eegapi-gateway.modal.run/v1/status', {
method: "GET",
headers: { Authorization: `Bearer ${key}` },
signal: AbortSignal.timeout(60_000),
});
console.log(response.status, await response.text());curl -sS --request GET 'https://dydema--eegapi-gateway.modal.run/v1/status' \
--header "Authorization: Bearer $DYDEMA_API_KEY"Set DYDEMA_API_KEY. Run the complete examples →
/v1/usageGET /v1/usageRequest example
import os
import requests
response = requests.request(
"GET",
'https://dydema--eegapi-gateway.modal.run/v1/usage',
headers={"Authorization": f"Bearer {os.environ['DYDEMA_API_KEY']}"},
timeout=60,
)
print(response.status_code, response.text)// Node 22 or newer. Save as example.mjs and run: node example.mjs
const key = process.env.DYDEMA_API_KEY;
if (!key) throw new Error("set DYDEMA_API_KEY first");
const response = await fetch('https://dydema--eegapi-gateway.modal.run/v1/usage', {
method: "GET",
headers: { Authorization: `Bearer ${key}` },
signal: AbortSignal.timeout(60_000),
});
console.log(response.status, await response.text());curl -sS --request GET 'https://dydema--eegapi-gateway.modal.run/v1/usage' \
--header "Authorization: Bearer $DYDEMA_API_KEY"Set DYDEMA_API_KEY. Run the complete examples →
Wizard (task models)
/v1/task-modelsGET /v1/task-models| Parameter | In | Type |
|---|---|---|
limit | query | integer |
before | query | string | null |
Request example
import os
import requests
response = requests.request(
"GET",
'https://dydema--eegapi-gateway.modal.run/v1/task-models',
headers={"Authorization": f"Bearer {os.environ['DYDEMA_API_KEY']}"},
timeout=60,
)
print(response.status_code, response.text)// Node 22 or newer. Save as example.mjs and run: node example.mjs
const key = process.env.DYDEMA_API_KEY;
if (!key) throw new Error("set DYDEMA_API_KEY first");
const response = await fetch('https://dydema--eegapi-gateway.modal.run/v1/task-models', {
method: "GET",
headers: { Authorization: `Bearer ${key}` },
signal: AbortSignal.timeout(60_000),
});
console.log(response.status, await response.text());curl -sS --request GET 'https://dydema--eegapi-gateway.modal.run/v1/task-models' \
--header "Authorization: Bearer $DYDEMA_API_KEY"Set DYDEMA_API_KEY. Run the complete examples →
Responses
200 Response
422 Response
| Field | Type | Description |
|---|---|---|
detail | array<ValidationError> |
For refusals, see error codes and remedies.
/v1/task-modelsPOST /v1/task-modelsRequest example
import json
import os
import requests
response = requests.request(
"POST",
'https://dydema--eegapi-gateway.modal.run/v1/task-models',
headers={"Authorization": f"Bearer {os.environ['DYDEMA_API_KEY']}"},
json=json.load(open("request.json")),
timeout=60,
)
print(response.status_code, response.text)// Node 22 or newer. Save as example.mjs and run: node example.mjs
import fs from "node:fs";
const key = process.env.DYDEMA_API_KEY;
if (!key) throw new Error("set DYDEMA_API_KEY first");
const response = await fetch('https://dydema--eegapi-gateway.modal.run/v1/task-models', {
method: "POST",
headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" },
body: fs.readFileSync("request.json", "utf8"),
signal: AbortSignal.timeout(60_000),
});
console.log(response.status, await response.text());curl -sS --request POST 'https://dydema--eegapi-gateway.modal.run/v1/task-models' \
--header "Authorization: Bearer $DYDEMA_API_KEY" \
--header 'Content-Type: application/json' \
--data @request.jsonSet DYDEMA_API_KEY and create request.json using the fields below. Run the complete examples →
| Field | Type | Description |
|---|---|---|
xrequired | array<object> | string | |
shape | array<any> | null | |
sampling_rate_hzrequired | number | |
unitsrequired | "uV" | "mV" | "V" | "unitless" | "normalized" | "unknown" | |
channelsrequired | array<string> | |
positions | array<array<any>> | null | |
position_frame | string | |
normalization_context | NormalizationContext | null | |
parameters | object | |
session | string | null | |
stride_seconds | number | null | |
missing_channels | "nearest" | "reject" | |
labelsrequired | array<string> | |
sessions | array<string> | null | |
name | string | null | |
description | string | |
expires_at | string | null | |
expires_in_days | integer | null | |
defer_fit | boolean | |
dry_run | boolean |
Responses
201 Response
422 Response
| Field | Type | Description |
|---|---|---|
detail | array<ValidationError> |
For refusals, see error codes and remedies.
/v1/task-models/{model_id}DELETE /v1/task-models/{model_id}| Parameter | In | Type |
|---|---|---|
model_idrequired | path | string |
Request example
import os
import requests
response = requests.request(
"DELETE",
'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}',
headers={"Authorization": f"Bearer {os.environ['DYDEMA_API_KEY']}"},
timeout=60,
)
print(response.status_code, response.text)// Node 22 or newer. Save as example.mjs and run: node example.mjs
const key = process.env.DYDEMA_API_KEY;
if (!key) throw new Error("set DYDEMA_API_KEY first");
const response = await fetch('https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}', {
method: "DELETE",
headers: { Authorization: `Bearer ${key}` },
signal: AbortSignal.timeout(60_000),
});
console.log(response.status, await response.text());curl -sS --request DELETE 'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}' \
--header "Authorization: Bearer $DYDEMA_API_KEY"Set DYDEMA_API_KEY, replace the path parameters in braces. Run the complete examples →
Responses
200 Response
422 Response
| Field | Type | Description |
|---|---|---|
detail | array<ValidationError> |
For refusals, see error codes and remedies.
/v1/task-models/{model_id}GET /v1/task-models/{model_id}| Parameter | In | Type |
|---|---|---|
model_idrequired | path | string |
Request example
import os
import requests
response = requests.request(
"GET",
'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}',
headers={"Authorization": f"Bearer {os.environ['DYDEMA_API_KEY']}"},
timeout=60,
)
print(response.status_code, response.text)// Node 22 or newer. Save as example.mjs and run: node example.mjs
const key = process.env.DYDEMA_API_KEY;
if (!key) throw new Error("set DYDEMA_API_KEY first");
const response = await fetch('https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}', {
method: "GET",
headers: { Authorization: `Bearer ${key}` },
signal: AbortSignal.timeout(60_000),
});
console.log(response.status, await response.text());curl -sS --request GET 'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}' \
--header "Authorization: Bearer $DYDEMA_API_KEY"Set DYDEMA_API_KEY, replace the path parameters in braces. Run the complete examples →
Responses
200 Response
422 Response
| Field | Type | Description |
|---|---|---|
detail | array<ValidationError> |
For refusals, see error codes and remedies.
/v1/task-models/{model_id}PATCH /v1/task-models/{model_id}| Parameter | In | Type |
|---|---|---|
model_idrequired | path | string |
Request example
import json
import os
import requests
response = requests.request(
"PATCH",
'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}',
headers={"Authorization": f"Bearer {os.environ['DYDEMA_API_KEY']}"},
json=json.load(open("request.json")),
timeout=60,
)
print(response.status_code, response.text)// Node 22 or newer. Save as example.mjs and run: node example.mjs
import fs from "node:fs";
const key = process.env.DYDEMA_API_KEY;
if (!key) throw new Error("set DYDEMA_API_KEY first");
const response = await fetch('https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}', {
method: "PATCH",
headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" },
body: fs.readFileSync("request.json", "utf8"),
signal: AbortSignal.timeout(60_000),
});
console.log(response.status, await response.text());curl -sS --request PATCH 'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}' \
--header "Authorization: Bearer $DYDEMA_API_KEY" \
--header 'Content-Type: application/json' \
--data @request.jsonSet DYDEMA_API_KEY, replace the path parameters in braces and create request.json using the fields below. Run the complete examples →
| Field | Type | Description |
|---|---|---|
expires_at | string | null | |
name | string | null |
Responses
200 Response
422 Response
| Field | Type | Description |
|---|---|---|
detail | array<ValidationError> |
For refusals, see error codes and remedies.
/v1/task-models/{model_id}/fitPOST /v1/task-models/{model_id}/fit| Parameter | In | Type |
|---|---|---|
model_idrequired | path | string |
Request example
import os
import requests
response = requests.request(
"POST",
'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}/fit',
headers={"Authorization": f"Bearer {os.environ['DYDEMA_API_KEY']}"},
timeout=60,
)
print(response.status_code, response.text)// Node 22 or newer. Save as example.mjs and run: node example.mjs
const key = process.env.DYDEMA_API_KEY;
if (!key) throw new Error("set DYDEMA_API_KEY first");
const response = await fetch('https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}/fit', {
method: "POST",
headers: { Authorization: `Bearer ${key}` },
signal: AbortSignal.timeout(60_000),
});
console.log(response.status, await response.text());curl -sS --request POST 'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}/fit' \
--header "Authorization: Bearer $DYDEMA_API_KEY"Set DYDEMA_API_KEY, replace the path parameters in braces. Run the complete examples →
Responses
200 Response
422 Response
| Field | Type | Description |
|---|---|---|
detail | array<ValidationError> |
For refusals, see error codes and remedies.
/v1/task-models/{model_id}/predictionsPOST /v1/task-models/{model_id}/predictions| Parameter | In | Type |
|---|---|---|
model_idrequired | path | string |
Request example
import json
import os
import requests
response = requests.request(
"POST",
'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}/predictions',
headers={"Authorization": f"Bearer {os.environ['DYDEMA_API_KEY']}"},
json=json.load(open("request.json")),
timeout=60,
)
print(response.status_code, response.text)// Node 22 or newer. Save as example.mjs and run: node example.mjs
import fs from "node:fs";
const key = process.env.DYDEMA_API_KEY;
if (!key) throw new Error("set DYDEMA_API_KEY first");
const response = await fetch('https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}/predictions', {
method: "POST",
headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" },
body: fs.readFileSync("request.json", "utf8"),
signal: AbortSignal.timeout(60_000),
});
console.log(response.status, await response.text());curl -sS --request POST 'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}/predictions' \
--header "Authorization: Bearer $DYDEMA_API_KEY" \
--header 'Content-Type: application/json' \
--data @request.jsonSet DYDEMA_API_KEY, replace the path parameters in braces and create request.json using the fields below. Run the complete examples →
| Field | Type | Description |
|---|---|---|
xrequired | array<object> | string | |
shape | array<any> | null | |
sampling_rate_hzrequired | number | |
unitsrequired | "uV" | "mV" | "V" | "unitless" | "normalized" | "unknown" | |
channelsrequired | array<string> | |
positions | array<array<any>> | null | |
position_frame | string | |
normalization_context | NormalizationContext | null | |
parameters | object | |
session | string | null | |
stride_seconds | number | null | |
missing_channels | "nearest" | "reject" | |
align | "none" | "batch" |
Responses
200 Response
422 Response
| Field | Type | Description |
|---|---|---|
detail | array<ValidationError> |
For refusals, see error codes and remedies.
/v1/task-models/{model_id}/trialsPOST /v1/task-models/{model_id}/trials| Parameter | In | Type |
|---|---|---|
model_idrequired | path | string |
Request example
import json
import os
import requests
response = requests.request(
"POST",
'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}/trials',
headers={"Authorization": f"Bearer {os.environ['DYDEMA_API_KEY']}"},
json=json.load(open("request.json")),
timeout=60,
)
print(response.status_code, response.text)// Node 22 or newer. Save as example.mjs and run: node example.mjs
import fs from "node:fs";
const key = process.env.DYDEMA_API_KEY;
if (!key) throw new Error("set DYDEMA_API_KEY first");
const response = await fetch('https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}/trials', {
method: "POST",
headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" },
body: fs.readFileSync("request.json", "utf8"),
signal: AbortSignal.timeout(60_000),
});
console.log(response.status, await response.text());curl -sS --request POST 'https://dydema--eegapi-gateway.modal.run/v1/task-models/{model_id}/trials' \
--header "Authorization: Bearer $DYDEMA_API_KEY" \
--header 'Content-Type: application/json' \
--data @request.jsonSet DYDEMA_API_KEY, replace the path parameters in braces and create request.json using the fields below. Run the complete examples →
| Field | Type | Description |
|---|---|---|
xrequired | array<object> | string | |
shape | array<any> | null | |
sampling_rate_hzrequired | number | |
unitsrequired | "uV" | "mV" | "V" | "unitless" | "normalized" | "unknown" | |
channelsrequired | array<string> | |
positions | array<array<any>> | null | |
position_frame | string | |
normalization_context | NormalizationContext | null | |
parameters | object | |
session | string | null | |
stride_seconds | number | null | |
missing_channels | "nearest" | "reject" | |
labelsrequired | array<string> | |
sessions | array<string> | null |
Responses
200 Response
422 Response
| Field | Type | Description |
|---|---|---|
detail | array<ValidationError> |
For refusals, see error codes and remedies.
Schemas
NormalizationContext
| Field | Type | Description |
|---|---|---|
dataset_id | array<string | null> | null | |
subject_uid | array<string | null> | null | |
session_id | array<string | null> | null |
PatchRequest
| Field | Type | Description |
|---|---|---|
expires_at | string | null | |
name | string | null |
TaskModelPredictRequest
| Field | Type | Description |
|---|---|---|
xrequired | array<object> | string | |
shape | array<any> | null | |
sampling_rate_hzrequired | number | |
unitsrequired | "uV" | "mV" | "V" | "unitless" | "normalized" | "unknown" | |
channelsrequired | array<string> | |
positions | array<array<any>> | null | |
position_frame | string | |
normalization_context | NormalizationContext | null | |
parameters | object | |
session | string | null | |
stride_seconds | number | null | |
missing_channels | "nearest" | "reject" | |
align | "none" | "batch" |
TaskModelRequest
| Field | Type | Description |
|---|---|---|
xrequired | array<object> | string | |
shape | array<any> | null | |
sampling_rate_hzrequired | number | |
unitsrequired | "uV" | "mV" | "V" | "unitless" | "normalized" | "unknown" | |
channelsrequired | array<string> | |
positions | array<array<any>> | null | |
position_frame | string | |
normalization_context | NormalizationContext | null | |
parameters | object | |
session | string | null | |
stride_seconds | number | null | |
missing_channels | "nearest" | "reject" | |
labelsrequired | array<string> | |
sessions | array<string> | null | |
name | string | null | |
description | string | |
expires_at | string | null | |
expires_in_days | integer | null | |
defer_fit | boolean | |
dry_run | boolean |
TrialsRequest
| Field | Type | Description |
|---|---|---|
xrequired | array<object> | string | |
shape | array<any> | null | |
sampling_rate_hzrequired | number | |
unitsrequired | "uV" | "mV" | "V" | "unitless" | "normalized" | "unknown" | |
channelsrequired | array<string> | |
positions | array<array<any>> | null | |
position_frame | string | |
normalization_context | NormalizationContext | null | |
parameters | object | |
session | string | null | |
stride_seconds | number | null | |
missing_channels | "nearest" | "reject" | |
labelsrequired | array<string> | |
sessions | array<string> | null |