Compute API
REST API for managing compute instances on the fal platform.
Authentication
All API requests require authentication using a fal API key.
Header Format
Authorization: Key <FAL_ADMIN_API_KEY>Getting Your API Key
- Navigate to the fal dashboard keys page
- Generate a key from the UI
- Choose the admin scope for compute
Base URL
https://rest.alpha.fal.aiEndpoints
1. List All Instances
GET /compute/instances
Returns a list of all compute instances.
curl -X GET "https://rest.alpha.fal.ai/compute/instances" \ -H "Authorization: Key <YOUR_FAL_ADMIN_API_KEY>"Response:
[ { "id": "550e8400-e29b-41d4-a716-446655440000", "instance_type": "gpu_1x_h100_sxm5", "ip": "192.168.1.100", "status": "ready" }, { "id": "550e8400-e29b-41d4-a716-446655440001", "instance_type": "gpu_8x_h100_sxm5", "sector": "sector_2", "ip": "192.168.1.101", "status": "provisioning" }]2. Get Instance Details
GET /compute/instance/{instance_id}
Retrieves details for a specific compute instance.
curl -X GET "https://rest.alpha.fal.ai/compute/instance/your-instance-id" \ -H "Authorization: Key <YOUR_FAL_ADMIN_API_KEY>"Response:
{ "id": "550e8400-e29b-41d4-a716-446655440000", "instance_type": "gpu_1x_h100_sxm5", "ip": "192.168.1.100", "status": "ready"}3. Create Instance
POST /compute/instance
Creates a new compute instance.
Request Body:
{ "instance_type": "gpu_8x_h100_sxm5", "ssh_key": "ssh-rsa ...",}Parameters:
instance_type(required): The type of compute instance. Valid values:gpu_8x_h100_sxm5- 8x H100 SXM5 GPUsgpu_1x_h100_sxm5- 1x H100 SXM5 GPU
ssh_key(required): SSH public key for instance accesssector(optional): Specific sector configuration for infiniband. Only valid withgpu_8x_h100_sxm5Valid values:sector_1sector_2sector_3
Example:
curl -X POST "https://rest.alpha.fal.ai/compute/instance" \ -H "Authorization: Key <YOUR_FAL_ADMIN_API_KEY>" \ -H "Content-Type: application/json" \ -d '{ "instance_type": "gpu_1x_h100_sxm5", "ssh_key": "ssh-rsa ...", }'4. Delete Instance
DELETE /compute/instance/{instance_id}
Deletes a specific compute instance.
curl -X DELETE "https://rest.alpha.fal.ai/compute/instance/your-instance-id" \ -H "Authorization: Key <YOUR_FAL_ADMIN_API_KEY>"Response Format
ComputeInstance Object
All instance-related endpoints return a ComputeInstance object or array of objects with the following structure:
{ "id": "550e8400-e29b-41d4-a716-446655440000", "instance_type": "gpu_1x_h100_sxm5", "ip": "192.168.1.100", "status": "ready"}Fields:
id: Unique identifier (UUID) for the instanceinstance_type: Type of compute instance (see available types above)sector: Sector configuration (can benull)ip: IP address of the instance (can benullif not yet assigned)status: Current status of the instance
Instance Status Values
ready- Instance is ready for useinit- Instance is initializingpending- Instance creation is pendingprovisioning- Instance is being provisionedunknown- Status is unknown
Quick Start
- Get your API key from fal.ai/dashboard/keys with
ADMINscope - List existing instances to see your current setup
- Create a new instance with your preferred configuration
- Monitor and manage your instances as needed