Skip to main content

Before You Start

You’ll need:
  • Python - we recommend 3.11
  • A fal account (sign up is free)

Step 1: Install the CLI

pip install fal

Step 2: Authenticate

Get your API key from the fal dashboard and authenticate:
fal auth login
This opens your browser to authenticate with fal. Once complete, your credentials are saved locally.

Step 3: Create Your First App

Create a file called hello_world.py with this simple app:
import fal

class MyApp(fal.App):
    @fal.endpoint("/")
    def run(self) -> dict:
        return {"message": "Hello, World!"}
That’s it! This is the simplest possible fal app - it just returns a message when called.

Step 4: Test Your App Locally

First, run your app locally to test it:
fal run hello_world.py::MyApp
This command:
  • Starts your app as a service
  • Provides two URLs for interaction: a direct HTTP proxy and a web playground
  • Allows you to test your app without authentication while fal run is active
As soon as the app is ready, you’ll see a message like this:
INFO:     Application startup complete.
Now you can test your app by making HTTP requests to the provided URL:
curl $FAL_RUN_URL -H 'content-type: application/json' -H 'accept: application/json, */*;q=0.5' -d '{}'
You should see:
{"message": "Hello, World!"}
Alternatively, you can use the auto-generated playground web UI to interact with your app through a browser interface.

Step 5: Deploy Your App (Optional)

Once you’re satisfied, deploy it to create a persistent URL:
fal deploy hello_world.py::MyApp
This command:
  • Deploys your app as a serverless function
  • Makes your app available for requests, with runners managed automatically based on demand
  • Returns a unique persistent URL for your deployed app

What Just Happened?

🎉 Congratulations! You’ve successfully:
  1. Created a fal app: Built the simplest possible serverless function
  2. Tested locally: Ran your app and called it with an HTTP request
  3. Deployed to the cloud: Made your app accessible via REST API (if you chose to deploy)
The beauty of this workflow is you can test and iterate locally before deploying to production.

Next Steps

Now that you have a working app, you can: