curl -X DELETE https://api.galadriel.com/v1/leases/lse_xyz123 \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
response = requests.delete(
"https://api.galadriel.com/v1/leases/lse_xyz123",
headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
result = response.json()
print(f"Lease terminated: {result['lease_id']}")
print(f"Refund: ${result['refund_amount']}")
const response = await fetch(
'https://api.galadriel.com/v1/leases/lse_xyz123',
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
}
);
const result = await response.json();
console.log(`Lease terminated: ${result.lease_id}`);
console.log(`Refund: $${result.refund_amount}`);
{
"lease_id": "lse_xyz123",
"status": "terminated",
"terminated_at": "2025-11-11T18:00:00Z",
"original_end_time": "2025-11-12T14:00:00Z",
"hours_used": 4.0,
"hours_remaining": 20.0,
"rate": 1.40,
"refund_amount": 448.00,
"refunded_at": "2025-11-11T18:00:01Z"
}
Leases
Terminate Lease
Terminate an active lease early
DELETE
/
v1
/
leases
/
{lease_id}
curl -X DELETE https://api.galadriel.com/v1/leases/lse_xyz123 \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
response = requests.delete(
"https://api.galadriel.com/v1/leases/lse_xyz123",
headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
result = response.json()
print(f"Lease terminated: {result['lease_id']}")
print(f"Refund: ${result['refund_amount']}")
const response = await fetch(
'https://api.galadriel.com/v1/leases/lse_xyz123',
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
}
);
const result = await response.json();
console.log(`Lease terminated: ${result.lease_id}`);
console.log(`Refund: $${result.refund_amount}`);
{
"lease_id": "lse_xyz123",
"status": "terminated",
"terminated_at": "2025-11-11T18:00:00Z",
"original_end_time": "2025-11-12T14:00:00Z",
"hours_used": 4.0,
"hours_remaining": 20.0,
"rate": 1.40,
"refund_amount": 448.00,
"refunded_at": "2025-11-11T18:00:01Z"
}
Path Parameters
string
required
The lease ID to terminate
Response
string
The terminated lease ID
string
When the lease was terminated
number
Prorated refund for unused time
Termination is immediate. All pods will be deleted and access will be revoked within 60 seconds.
This action cannot be undone. Consider reselling unused time instead to recover more money.
curl -X DELETE https://api.galadriel.com/v1/leases/lse_xyz123 \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
response = requests.delete(
"https://api.galadriel.com/v1/leases/lse_xyz123",
headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
result = response.json()
print(f"Lease terminated: {result['lease_id']}")
print(f"Refund: ${result['refund_amount']}")
const response = await fetch(
'https://api.galadriel.com/v1/leases/lse_xyz123',
{
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
}
);
const result = await response.json();
console.log(`Lease terminated: ${result.lease_id}`);
console.log(`Refund: $${result.refund_amount}`);
{
"lease_id": "lse_xyz123",
"status": "terminated",
"terminated_at": "2025-11-11T18:00:00Z",
"original_end_time": "2025-11-12T14:00:00Z",
"hours_used": 4.0,
"hours_remaining": 20.0,
"rate": 1.40,
"refund_amount": 448.00,
"refunded_at": "2025-11-11T18:00:01Z"
}
What Happens on Termination
- Immediate: All running pods are deleted
- Within 60 seconds:
- Kubeconfig is invalidated
- SSH access is revoked
- Namespace is cleaned up
- Within 5 minutes: Refund is credited to your account
Alternative: Resell Instead
Consider reselling unused time to recover more money:# Instead of terminating
curl -X DELETE https://api.galadriel.com/v1/leases/lse_xyz123
# Resell for better recovery
curl -X POST https://api.galadriel.com/v1/leases/lse_xyz123/resell \
-d '{"limit_price": 1.20}'