Modal logo
GuideExamples
Reference
ChangelogPlayground
Log In Sign Up
Python SDK Reference modal.Appmodal.Clientmodal.CloudBucketMountmodal.Clsmodal.Cronmodal.Dictmodal.Environmentmodal.Errormodal.FilePatternMatchermodal.Functionmodal.FunctionCallmodal.Imagemodal.Periodmodal.Probemodal.Proxymodal.Queuemodal.Retriesmodal.Sandboxmodal.SandboxSnapshotmodal.Secretmodal.Servermodal.Tunnelmodal.Volumemodal.Workspacemodal.asgi_appmodal.batchedmodal.billingmodal.call_graphmodal.concurrentmodal.configmodal.container_processmodal.current_function_call_idmodal.current_input_idmodal.enable_outputmodal.entermodal.exceptionmodal.exitmodal.fastapi_endpointmodal.file_iomodal.forwardmodal.interactmodal.io_streamsmodal.is_localmodal.methodmodal.parametermodal.web_servermodal.wsgi_app

modal.asgi_app

asgi_app(*, label=None, custom_domains=None, requires_proxy_auth=False)

Decorator for registering an ASGI app as a Web Function.

Asynchronous Server Gateway Interface (ASGI) is a standard for Python web apps, supported by all popular Python web libraries.

To learn how to use Modal with popular web frameworks, see the guide on Web Functions.

Usage

from typing import Callable

@app.function()
@modal.asgi_app()
def create_asgi() -> Callable:
    ...
modal.asgi_app
Modal logo © Modal 2026
About Status Changelog Documentation Slack Community Pricing Examples