Sessions
Inspect the sessions that group your training runs and samplers, and assign them to projects.
A session groups the training runs and
samplers you open together. IDs make the relationship visible:
run run_3Bz and sampler sess_A1:sample:0 both live under session sess_A1.
Use sessions to see what is currently open under your account, and to move a body of work, runs, samplers and all, into a project for access control and cost attribution.
List sessions
/v1/sessionsscope: readReturns a paginated list of session IDs. See Pagination for how limit,
offset and the cursor object behave across list endpoints.
Query parameters
limitintegerMaximum number of sessions to return.
offsetintegerNumber of sessions to skip from the start of the list.
access_scopestringowned returns only sessions you created; accessible includes sessions shared with you
through project membership.
curl "https://api.nucleus-ai.io/v1/sessions?access_scope=owned" \
-H "Authorization: Bearer $NUCLEUS_API_KEY"{
"sessions": ["sess_A1", "sess_B7"],
"cursor": { "total_count": 2 }
}Retrieve a session
/v1/sessions/{session_id}scope: readReturns everything opened under one session: its training run IDs and sampler IDs. Use it to audit what a loop left open before deciding what to close.
Path parameters
session_idstringrequiredID of the session.
Query parameters
access_scopestringowned resolves the session only among those you created; accessible also covers sessions
shared with you through project membership.
curl https://api.nucleus-ai.io/v1/sessions/sess_A1 \
-H "Authorization: Bearer $NUCLEUS_API_KEY"{
"session_id": "sess_A1",
"training_run_ids": ["run_3Bz"],
"sampler_ids": ["sess_A1:sample:0"]
}Assign a session to a project
/v1/sessions/{session_id}scope: adminMoves a session, and everything under it, into a project. The session's training runs and samplers become subject to the project's access rules, so keys bound to a different project can no longer reach them.
Assignment is one way: once a session belongs to a project it cannot be detached or moved to another project, so assign deliberately.
Path parameters
session_idstringrequiredID of the session to assign.
Body parameters
project_idstringrequiredID of the project to move the session into.
curl -X PATCH https://api.nucleus-ai.io/v1/sessions/sess_A1 \
-H "Authorization: Bearer $NUCLEUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"project_id": "proj_acme"}'{
"session_id": "sess_A1",
"project_id": "proj_acme"
}