Connect to AI
Cloud Infrastructure Bearer Token

Modal REST API

Serverless compute platform for AI/ML workloads

Modal is a serverless compute platform designed for running AI/ML workloads, data pipelines, and backend services. Developers use Modal to deploy functions that scale from zero to thousands of containers automatically, with built-in GPU support and dependency management. The platform handles all infrastructure complexity while providing pay-per-use pricing for compute resources.

Base URL https://api.modal.com/v1

API Endpoints

MethodEndpointDescription
POST/functions/deployDeploy a new function to Modal's serverless infrastructure
GET/functions/{function_id}Retrieve details about a deployed function including status and configuration
POST/functions/{function_id}/invokeInvoke a deployed function synchronously and return results
DELETE/functions/{function_id}Delete a deployed function and release associated resources
GET/appsList all deployed apps and their associated functions
POST/apps/{app_id}/redeployRedeploy an existing app with updated code or configuration
GET/volumesList all persistent volumes attached to your workspace
POST/volumesCreate a new persistent volume for storing data across function invocations
GET/secretsList all secrets available in your workspace
POST/secretsCreate a new secret for secure credential storage
GET/logs/{function_id}Retrieve execution logs for a specific function
GET/usageGet compute usage statistics and billing information
POST/images/buildBuild a custom container image with specified dependencies
GET/imagesList all custom container images in your workspace
GET/schedulesList all scheduled function executions

Code Examples

curl -X POST https://api.modal.com/v1/functions/func_abc123/invoke \
  -H 'Authorization: Bearer modal_token_xyz789' \
  -H 'Content-Type: application/json' \
  -d '{
    "args": ["input_data"],
    "kwargs": {"param": "value"}
  }'

Use Modal from Claude / Cursor / ChatGPT

Get a hosted MCP endpoint for Modal. Paste your Modal API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls Modal directly with your credentials — no local install, works on mobile.

deploy_modal_function Deploy a new serverless function to Modal with specified code, dependencies, and GPU requirements
invoke_modal_function Execute a deployed Modal function with provided arguments and return results
list_modal_apps Retrieve all deployed Modal applications and their current status
create_modal_volume Create a persistent volume for storing data across function invocations
get_modal_logs Fetch execution logs and debugging information for Modal functions

Connect in 60 seconds

Paste your Modal key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.

Connect Modal to your AI →

Related APIs