Run it and troubleshoot
Run the program, read the output, fix common problems.
Run it
python soundscape.py "rainy night street" --mood calm --out kit
python soundscape.py "busy market at noon" --mood lively --music-seconds 60 --backgroundExpected output. This is a real run of the finished programs against the tutorial's mock server (see Set up the project), which charges 5 PLUMES per sound and 40 for the music, so the last line says 55. With a real key the file ids are real and the last line shows what your administrator's prices add up to:
Balance: 1000 plumes
Generating 3 ambience layers...
saved kit/ambience-1.mp3
saved kit/ambience-2.mp3
saved kit/ambience-3.mp3
Composing 30s of music...
saved kit/music.mp3
Done. 55 plumes spent. Manifest: kit/manifest.jsonand a folder:
kit/
├── ambience-1.mp3
├── ambience-2.mp3
├── ambience-3.mp3
├── music.mp3
└── manifest.jsonThe background variant prints the job's state as it changes:
Balance: 1000 plumes
Generating 3 ambience layers...
saved kit/ambience-1.mp3
saved kit/ambience-2.mp3
saved kit/ambience-3.mp3
Composing 60s of music in the background...
music is running
music is completed
saved kit/music.mp3
Done. 55 plumes spent. Manifest: kit/manifest.json(From the same mock run. How many music is ... lines you see depends on how often the job's state changes while you wait.)
Try the errors on purpose
Each command below was run against the mock with the environment shown; the output is what the finished program prints. The mock can also make the music call fail: start it with MOCK_FAIL=quota or MOCK_FAIL=ratelimit.
No key set
unset FALCORE_API_KEYNo API key. Pass api_key=... or set the FALCORE_API_KEY environment variable.A wrong key (FALCORE_API_KEY=wrong)
Your key was refused (UNAUTHORIZED). Check FALCORE_API_KEY.Out of plumes (mock started with MOCK_FAIL=quota; the three sounds are saved, then the music call is refused)
Balance: 1000 plumes
Generating 3 ambience layers...
saved kit/ambience-1.mp3
saved kit/ambience-2.mp3
saved kit/ambience-3.mp3
Composing 30s of music...
Out of plumes: {'balance': 0, 'required': 40, 'unit': 'PLUMES'}. Nothing was charged for the failed call.Rate limited (mock started with MOCK_FAIL=ratelimit; same lines before the last one)
Slow down: try again in 1.0 seconds.No network (FALCORE_BASE_URL=http://127.0.0.1:9, where nothing is listening)
Could not reach the API. Check your network and try again.The program exits with status 1 after any of these and 0 when the kit is built.
Checkpoint (M5): a colleague with only a key can run it from your instructions and get the same folder shape.
Ship it (M6)
Switch the key from fal_test_ to fal_live_ in the deployment environment only, never in code. Run once with the live key on a short scene and compare the manifest's cost with the usage numbers.
Troubleshooting
| You see | Cause | Fix |
|---|---|---|
No API key. Pass api_key=... or set the FALCORE_API_KEY environment variable. | The variable is not set in this terminal. | export FALCORE_API_KEY=... in the same terminal you run the program from. |
Your key was refused (UNAUTHORIZED) | Wrong, revoked or expired key. | Check the key with your administrator. KEY_EXPIRED means it expired. |
steps: must be at least 10 and at most 50 | A local check caught a bad value. Nothing was sent. | Use a value inside the limit. See the SDK reference. |
session_id: is required to download "fil_..." | You passed a bare file id the SDK has not seen. | Pass the session, or use the file object a call returned. |
Out of plumes | The balance is used up. | Top up, or use a fal_test_ key. Nothing was charged for the failed call. |
Could not reach the API | Network down, or a wrong FALCORE_BASE_URL. | Unset FALCORE_BASE_URL to use the real API. |
ModuleNotFoundError: falcore / Cannot find package '@falcore/sdk' | The SDK is not installed in this environment. | Activate the venv, or run npm i in the project folder. |