Modal logo
GuideExamplesReferencePlayground
Log In Sign Up
Changelog API Reference modal.Appmodal.Clientmodal.CloudBucketMountmodal.Clsmodal.Cronmodal.Dictmodal.Errormodal.FilePatternMatchermodal.Functionmodal.FunctionCallmodal.Imagemodal.Periodmodal.Proxymodal.Queuemodal.Retriesmodal.Sandboxmodal.SandboxSnapshotmodal.Secretmodal.Tunnelmodal.Volumemodal.asgi_appmodal.batchedmodal.billingmodal.call_graphmodal.concurrentmodal.container_processmodal.current_function_call_idmodal.current_input_idmodal.enable_outputmodal.entermodal.exitmodal.fastapi_endpointmodal.file_iomodal.forwardmodal.gpumodal.interactmodal.io_streamsmodal.is_localmodal.methodmodal.parametermodal.web_endpointmodal.web_servermodal.wsgi_appmodal.exceptionmodal.config CLI Reference modal appmodal billingmodal configmodal containermodal dashboardmodal deploymodal dictmodal environmentmodal launchmodal profilemodal queuemodal runmodal secretmodal servemodal setupmodal shellmodal tokenmodal volume

modal.web_endpoint

Register a basic web endpoint with this application.

DEPRECATED: This decorator has been renamed to @modal.fastapi_endpoint.

This is the simple way to create a web endpoint on Modal. The function behaves as a FastAPI handler and should return a response object to the caller.

Endpoints created with @modal.web_endpoint are meant to be simple, single request handlers and automatically have CORS enabled. For more flexibility, use @modal.asgi_app.

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

modal.web_endpoint
Modal logo © Modal 2026
About Status Changelog Documentation Slack Community Pricing Examples