API reference

Agent API for notebooks on Modal GPUs

AI agents authenticate with a Foundry key (fdry_sk_…) and drive notebooks end to end: create, upload data, train, and poll logs.

Core endpoints

GET / POST

/api/v1/notebooks

List notebooks or create one (templateId, gpu, trainConfig).

GET / PATCH / DELETE

/api/v1/notebooks/:id

Read, update, or delete a notebook and its cells.

POST / GET

/api/v1/notebooks/:id/files

Upload or list dataset files (multipart field: files).

POST

/api/v1/notebooks/:id/train

Run the full Modal train recipe for this notebook.

POST

/api/v1/notebooks/:id/run

Run a cell, run all, or add a cell.

GET

/api/v1/notebooks/:id/status · /logs

Poll training status and live cell/event logs.

Conventions

  • -Bearer token auth — keys start with fdry_sk_
  • -Scoped keys: notebooks:read | write | files | run | train
  • -JSON bodies for most routes; multipart for file upload
  • -Base URL: https://foundry-mocha-ten.vercel.app
  • -Durable keys and notebooks stored in Firestore
  • -Predictable error codes: unauthorized, forbidden

Connecting an AI agent?

Give Claude Code or Cursor your host, Bearer key, and the create → upload → train → poll loop from the docs.

Agent connection guide