Deepnote research: our notes on building agents
Get started
All endpoint groups

Deepnote Public API v2

Machines API

The machines that run project code in the editor and in live-mode runs.

Base URL

https://api.deepnote.com/v2

List machine types

List the machine types (sizes) projects in the workspace can run on, with their vCPUs, memory and GPUs and whether the workspace's plan allows them: Deepnote's machine types first, in the order the editor lists them, then the workspace's custom machines sorted by name. Custom machines are listed only for members who can view the workspace's integrations.

get/machine-types

Responses

▸200List of machine types
application/jsonListMachineTypesResponse
machineTypesrequiredMachineType[]
▸401Unauthorized
application/jsonErrorResponse
messagerequiredstring
▸403Insufficient permissions
application/jsonErrorResponse
messagerequiredstring
▸429Rate limit exceeded
application/jsonErrorResponse
messagerequiredstring
▸500Internal server error
application/jsonErrorResponse
messagerequiredstring

Get the state of a project's editor machine

Reports whether the project machine is running, and its machine type. Cheap enough to poll while the machine starts or stops. This is the machine the editor, live-mode runs and hosted Streamlit apps use; detached runs and interactive sessions run on machines of their own, which this endpoint does not report.

get/projects/{projectId}/machine

Parameters

projectIdpathrequiredstring:uuid

ID of the project whose machine to use.

Responses

▸200Current state of the project machine
application/jsonMachineResponse
machinerequiredMachine

The project's machine: the one the editor, live-mode runs and hosted Streamlit apps use. Detached runs and interactive sessions run on machines of their own and are not reflected here.

▸400Validation error
application/jsonErrorResponse
messagerequiredstring
▸401Unauthorized
application/jsonErrorResponse
messagerequiredstring
▸403Insufficient permissions
application/jsonErrorResponse
messagerequiredstring
▸404Project not found
application/jsonErrorResponse
messagerequiredstring
▸409Project is suspended
application/jsonErrorResponse
messagerequiredstring
▸429Rate limit exceeded
application/jsonErrorResponse
messagerequiredstring
▸500Internal server error
application/jsonErrorResponse
messagerequiredstring

Change a project's editor machine type or idle shutdown

Changes the machine type or idle shutdown of the project machine. A new idle shutdown applies right away, and a stopped machine uses the new type the next time it starts. Changing the type of a running machine requires `restart: true`; without it, the request returns 409 and changes nothing. If the restarted machine cannot start, the request returns 409 but keeps the new type. To run a single detached run or session on another machine type, pass `machineType` when creating it.

patch/projects/{projectId}/machine

Parameters

projectIdpathrequiredstring:uuid

ID of the project whose machine to use.

Request body

required
application/jsonobject
typestring

Machine type for the project, as an `id` from `GET /machine-types`.

idleShutdownSecondsinteger

How long the machine keeps running without activity before it shuts down, in seconds, up to 24 hours.

restartboolean

Restart a running machine so a new `type` takes effect. Kernel state, such as variables, is lost.

Responses

▸200Updated project machine
application/jsonMachineResponse
machinerequiredMachine

The project's machine: the one the editor, live-mode runs and hosted Streamlit apps use. Detached runs and interactive sessions run on machines of their own and are not reflected here.

▸400Validation error
application/jsonErrorResponse
messagerequiredstring
▸401Unauthorized
application/jsonErrorResponse
messagerequiredstring
▸403Insufficient permissions
application/jsonErrorResponse
messagerequiredstring
▸404Project not found
application/jsonErrorResponse
messagerequiredstring
▸409Project is suspended, the machine is running and `restart` is not set, the machine type is not allowed by the plan, or the restarted machine cannot start
application/jsonErrorResponse
messagerequiredstring
▸429Rate limit exceeded
application/jsonErrorResponse
messagerequiredstring
▸500Internal server error
application/jsonErrorResponse
messagerequiredstring

Restart a project's editor machine

Stops the project machine and starts a new one, which recovers a machine in the `error` status. Kernel state, such as variables, is lost for everyone working in the project. Returns without waiting for the new machine to boot; poll `GET /projects/{projectId}/machine` until the status is `running`. Restarting a stopped machine starts it. This is the machine the editor, live-mode runs and hosted Streamlit apps use; machines of detached runs and interactive sessions are not affected.

post/projects/{projectId}/machine/restart

Parameters

projectIdpathrequiredstring:uuid

ID of the project whose machine to use.

Responses

▸202Machine restart accepted
application/jsonMachineResponse
machinerequiredMachine

The project's machine: the one the editor, live-mode runs and hosted Streamlit apps use. Detached runs and interactive sessions run on machines of their own and are not reflected here.

▸400Validation error
application/jsonErrorResponse
messagerequiredstring
▸401Unauthorized
application/jsonErrorResponse
messagerequiredstring
▸403Insufficient permissions
application/jsonErrorResponse
messagerequiredstring
▸404Project not found
application/jsonErrorResponse
messagerequiredstring
▸409Project is suspended, the new machine cannot start yet, the plan machine limit is reached, or pay-as-you-go is disabled
application/jsonErrorResponse
messagerequiredstring
▸429Rate limit exceeded
application/jsonErrorResponse
messagerequiredstring
▸500Internal server error
application/jsonErrorResponse
messagerequiredstring

Start a project's editor machine

Starts the project machine and returns without waiting for it to boot; poll `GET /projects/{projectId}/machine` until the status is `running`. Starting a machine that is already starting or running does nothing and succeeds. Running a notebook in live mode starts the machine too. This is the machine the editor, live-mode runs and hosted Streamlit apps use; detached runs and interactive sessions start machines of their own, so there is no need to start this one for them.

post/projects/{projectId}/machine/start

Parameters

projectIdpathrequiredstring:uuid

ID of the project whose machine to use.

Responses

▸202Machine start accepted
application/jsonMachineResponse
machinerequiredMachine

The project's machine: the one the editor, live-mode runs and hosted Streamlit apps use. Detached runs and interactive sessions run on machines of their own and are not reflected here.

▸400Validation error
application/jsonErrorResponse
messagerequiredstring
▸401Unauthorized
application/jsonErrorResponse
messagerequiredstring
▸403Insufficient permissions
application/jsonErrorResponse
messagerequiredstring
▸404Project not found
application/jsonErrorResponse
messagerequiredstring
▸409Project is suspended, the machine is stopping or in an error state (restart it instead), the plan machine limit is reached, or pay-as-you-go is disabled
application/jsonErrorResponse
messagerequiredstring
▸429Rate limit exceeded
application/jsonErrorResponse
messagerequiredstring
▸500Internal server error
application/jsonErrorResponse
messagerequiredstring

Stop a project's editor machine

Stops the project machine so it no longer uses machine time. Kernel state, such as variables, is lost for everyone working in the project; files in the project are kept. Stopping a machine that is not running does nothing and succeeds. This is the machine the editor, live-mode runs and hosted Streamlit apps use; machines of detached runs and interactive sessions keep running. Stop a session with `DELETE /sessions/{sessionId}`.

post/projects/{projectId}/machine/stop

Parameters

projectIdpathrequiredstring:uuid

ID of the project whose machine to use.

Responses

▸202Machine stop accepted
application/jsonMachineResponse
machinerequiredMachine

The project's machine: the one the editor, live-mode runs and hosted Streamlit apps use. Detached runs and interactive sessions run on machines of their own and are not reflected here.

▸400Validation error
application/jsonErrorResponse
messagerequiredstring
▸401Unauthorized
application/jsonErrorResponse
messagerequiredstring
▸403Insufficient permissions
application/jsonErrorResponse
messagerequiredstring
▸404Project not found
application/jsonErrorResponse
messagerequiredstring
▸409Project is suspended
application/jsonErrorResponse
messagerequiredstring
▸429Rate limit exceeded
application/jsonErrorResponse
messagerequiredstring
▸500Internal server error
application/jsonErrorResponse
messagerequiredstring