Modal

Modal is a serverless cloud for AI, data, and general compute. Developers define infrastructure as code in Python (with JavaScript and Go SDKs) and run functions, GPUs, sandboxes, web endpoints, cron jobs, and volumes on demand. The primary developer interface is the Modal SDK and CLI communicating with a gRPC backend, not a conventional first-party REST API. User-deployed Modal Functions can be exposed as HTTPS web endpoints (@modal.fastapi_endpoint / asgi_app / wsgi_app / web_server) on *.modal.run, and Sandboxes can expose ports via network tunnels.

9 APIs 0 Features
ServerlessComputeGPUAI InfrastructureSandboxesInfrastructure as Code

APIs

Modal Functions and Remote Invocation

Decorate Python functions with @app.function to run them remotely on Modal's cloud. Invoke deployed functions synchronously (.remote), asynchronously (.spawn), in parallel (.map...

Modal Web Endpoints

The genuine HTTPS surface of the platform. User functions decorated with @modal.fastapi_endpoint, @modal.asgi_app, @modal.wsgi_app, or @modal.web_server are auto-deployed as HTT...

Modal Sandboxes

Secure containers for executing untrusted user or agent-generated code, created via Sandbox.create() in the Python, JavaScript, and Go SDKs. Supports exec() for arbitrary comman...

Modal Volumes

Distributed, high-performance file system volumes for sharing state across functions and containers, managed via modal.Volume in the SDK and the `modal volume` CLI. Read/write, ...

Modal Dicts and Queues

Distributed key-value store (modal.Dict) and distributed queue (modal.Queue) for passing state and messages between functions and containers. Accessed exclusively through the SD...

Modal Secrets

Securely inject environment variables and credentials into functions and sandboxes via modal.Secret, managed in the dashboard, CLI, or SDK (Secret.from_name / from_dict). SDK/CL...

Modal Cron and Scheduled Functions

Run functions on a recurring schedule using modal.Period or modal.Cron passed to @app.function(schedule=...). Schedules are declared in code and managed through deployment; ther...

Modal Images and GPU

Define container images programmatically with modal.Image (from_registry, debian_slim, pip_install, run_commands) and attach GPUs by passing gpu= (T4, L4, A10, L40S, A100, H100,...

Modal CLI

The `modal` command-line interface for deploying apps, running functions, tailing logs, managing volumes/secrets/dicts, and launching shells. Wraps the same gRPC control plane t...

Collections

Pricing Plans

Modal Labs Plans Pricing

4 plans

PLANS

Rate Limits

Modal Labs Rate Limits

6 limits

RATE LIMITS

FinOps

Resources

🔗
DomainSecurity
DomainSecurity
👥
GitHubOrganization
GitHubOrganization
🔗
LinkedIn
LinkedIn
🔗
Website
Website
🔗
Documentation
Documentation
🔗
Plans
Plans
🔗
RateLimits
RateLimits
🔗
FinOps
FinOps
📰
Blog
Blog

Sources

Raw ↑
opencollection: 1.0.0
info:
  name: Modal Web Endpoints (Representative)
  version: 1.0-representative
  description: REPRESENTATIVE collection - NOT a first-party Modal REST API. Modal's primary interface is the Python/JS/Go
    SDK and the `modal` CLI over gRPC. The only genuine HTTPS surface is user-deployed web endpoints on *.modal.run, whose
    routes and schemas are defined by the developer's own code. These requests illustrate the shape of a typical deployed
    endpoint.
request:
  auth:
    type: none
items:
- info:
    name: Web Endpoints
    type: folder
  items:
  - info:
      name: Invoke a GET web endpoint (representative).
      type: http
    http:
      method: GET
      url: https://your-workspace--your-app-your-endpoint.modal.run/?prompt=example
    docs: Representative GET handler for a function decorated with @modal.fastapi_endpoint(). Query parameters and response
      are defined by the developer's own code. Not a Modal-owned endpoint.
  - info:
      name: Invoke a POST web endpoint (representative).
      type: http
    http:
      method: POST
      url: https://your-workspace--your-app-your-endpoint.modal.run/
      body:
        type: json
        data: "{\n  \"input\": \"example value\"\n}"
    docs: Representative POST handler for @modal.fastapi_endpoint(method="POST") or an ASGI/WSGI app. Request/response bodies
      are defined by the developer's own code. Not a Modal-owned endpoint.
  - info:
      name: Invoke an arbitrary ASGI/WSGI route (representative).
      type: http
    http:
      method: GET
      url: https://your-workspace--your-app-your-endpoint.modal.run/any/developer/defined/route
    docs: For @modal.asgi_app / @modal.wsgi_app / @modal.web_server, the mounted app defines its own routes under the same
      *.modal.run host. Representative only.
- info:
    name: Sandboxes
    type: folder
  items:
  - info:
      name: Invoke a Sandbox tunnel port (representative).
      type: http
    http:
      method: GET
      url: https://<sandbox-tunnel-host>.modal.host/
    docs: A running Sandbox can expose a container port over an HTTPS network tunnel. Sandbox lifecycle (create/exec/terminate)
      is SDK/gRPC-only; only the tunneled port is HTTP, and its shape is user-defined. Representative only.
bundled: true