API docs
API reference

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

GET/v1/sessionsscope: read

Returns a paginated list of session IDs. See Pagination for how limit, offset and the cursor object behave across list endpoints.

Query parameters

limitinteger

Maximum number of sessions to return.

offsetinteger

Number of sessions to skip from the start of the list.

access_scopestring

owned 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"
200 OK
{
  "sessions": ["sess_A1", "sess_B7"],
  "cursor": { "total_count": 2 }
}

Retrieve a session

GET/v1/sessions/{session_id}scope: read

Returns 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_idstringrequired

ID of the session.

Query parameters

access_scopestring

owned 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"
200 OK
{
  "session_id": "sess_A1",
  "training_run_ids": ["run_3Bz"],
  "sampler_ids": ["sess_A1:sample:0"]
}

Assign a session to a project

PATCH/v1/sessions/{session_id}scope: admin

Moves 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_idstringrequired

ID of the session to assign.

Body parameters

project_idstringrequired

ID 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"}'
200 OK
{
  "session_id": "sess_A1",
  "project_id": "proj_acme"
}
Sessions | Nucleus AI API