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.
https://api.modal.com/v1
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /functions/deploy | Deploy 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}/invoke | Invoke a deployed function synchronously and return results |
| DELETE | /functions/{function_id} | Delete a deployed function and release associated resources |
| GET | /apps | List all deployed apps and their associated functions |
| POST | /apps/{app_id}/redeploy | Redeploy an existing app with updated code or configuration |
| GET | /volumes | List all persistent volumes attached to your workspace |
| POST | /volumes | Create a new persistent volume for storing data across function invocations |
| GET | /secrets | List all secrets available in your workspace |
| POST | /secrets | Create a new secret for secure credential storage |
| GET | /logs/{function_id} | Retrieve execution logs for a specific function |
| GET | /usage | Get compute usage statistics and billing information |
| POST | /images/build | Build a custom container image with specified dependencies |
| GET | /images | List all custom container images in your workspace |
| GET | /schedules | List all scheduled function executions |
Sponsor this page
AvailableReach developers actively building with Modal. See live pageview data and self-serve checkout — your slot goes live in minutes.
View inventory & pricing →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 →