Barrack API Documentation
  1. Billing
Barrack API Documentation
  • Platform Documentation
    • Getting Started
    • Authentication & Access
    • Account Management
    • API Keys
    • GPU Models
    • Regions
    • Instance
      • OS Images
      • Bootsource Management
      • Deploy Instance
      • Instance Management
      • Hibernation
      • View Instances
    • Billing
      • Credit Depletion & Resource Protection
    • SSH Keys
      • Add SSH Keys
      • Manage SSH Keys
      • Connecting to Your VM via SSH
    • Volumes
      • Overview
      • Create Volume
      • List and View Volumes
      • Attach Volumes
      • Detach Volumes
      • Clone Volumes
      • Resize Volume
      • Delete Volume
    • Advanced Configurations
      • Network And Security
      • Cloudinit Script
      • Startup Script
    • Firewall
      • Manage Firewall
      • Rules and Attachment
    • Snapshot
      • Overview
      • Manage Snapshots
      • Restore Snapshots
    • Custom Images
      • Overview
      • Create and Manage Images
  • Balance
    • Get credit balance
      GET
  • Deploy Instance
    • Create a new instance
      POST
  • Pricing
    • Get pricing information
      GET
    • Get pricing information
      POST
  • Instances
    • List instances
      GET
    • Delete instance
      DELETE
    • Hibernate instance
      POST
    • Reboot instance
      POST
    • Restore hibernated instance
      POST
    • Start instance
      POST
    • Stop instance
      POST
    • Toggle public IP for instance
      POST
    • Get instance details
      GET
    • Get firewalls attached to instance
      GET
    • Add instance security rule
      POST
    • Remove instance security rule
      DELETE
    • Get instance billing
      GET
    • List Instance eligible for snapshot creation
      GET
  • SSH Keys
    • List SSH keys
    • Create SSH key
    • Get SSH key
    • Delete SSH key
  • Volumes
    • Attach volumes to instance
    • Detach volumes from instance
    • List volumes
    • Create volume
    • Get volume details
    • Delete volume
    • Clone volume
    • Resize volume
    • Get volume billing
    • List available volume types
  • Scripts
    • List all startup scripts
    • Create a startup script
    • Get startup script details
    • Update a startup script
    • Delete a startup script
    • Delete multiple startup scripts
  • Snapshots
    • Create snapshot
    • List snapshots
    • Get snapshot details
    • Delete snapshot
    • Restore snapshot
    • Get snapshot billing
  • Images
    • List custom images
    • Get image details
    • Delete custom image
    • List OS images
    • Create image from snapshot
    • Get snapshot-image relationship
    • Get snapshot-image relationship list
  • Firewalls
    • List firewalls
    • Get firewall details
    • Attach firewall to instances
    • Delete firewall
    • Remove firewall rule
    • Add firewall rule
    • Create firewall
    • List instances available for firewall attachment
    • Get supported protocols
  • GPU Stocks
    • Get GPU stock availability
  • GPU Specs
    • Get GPU specifications
  • Regions
    • List available regions
  • Schemas
    • AddFirewallRuleRequest
    • APIKeyResponse
    • AddFirewallRuleResponse
    • AddVMSecurityRuleResponse
    • AttachFirewallRequest
    • AggregatedBillingResponse
    • AttachFirewallResponse
    • AttachVolumesRequest
    • AttachVolumesResponse
    • AttachedFirewall
    • BatchSnapshotImageRelationshipResponse
    • Balance
    • Billing
    • ChatCompletionsRequest
    • ChatCompletionsResponse
    • CloneVolumeRequest
    • BillingRecord
    • BillingBreakdown
    • CloneVolumeResponse
    • BillingSummary
    • CreateFirewallRequest
    • CreateFirewallResponse
    • BootSourceEnum
    • CreateImageFromSnapshotRequest
    • BulkDeleteResponse
    • CreateSSHKeyRequest
    • CreateScriptRequest
    • CreateSnapshotRequest
    • CreateSnapshotResponse
    • CreateSSHKeyResponse
    • ComputeBilling
    • CurrencyEnum
    • Data
    • CreditBalanceResponse
    • CreateAPIKeyRequest
    • DeleteFirewallResponse
    • CreateVolumeRequest
    • CreateAPIKeyRequestTierEnum
    • DeleteSnapshotResponse
    • CreateVolumeResponse
    • CreateAPIKeyResponse
    • DeleteVMResponse
    • DetachVolumesRequest
    • DetachVolumesResponse
    • DeploymentRequest
    • DirectionEnum
    • DeploymentResponse
    • CreateSnapshotData
    • EthertypeEnum
    • ErrorResponse
    • FirewallAttachment
    • DeleteVolumeResponse
    • DeleteSSHKeyResponse
    • FirewallEnvironment
    • FirewallResponse
    • FirewallRule
    • FirewallVM
    • DataVolumeBilling
    • GetBatchSnapshotImageRelationshipsRequest
    • GetFirewallDetailsResponse
    • GPUStockConfiguration
    • GPUSpec
    • GetHibernatedVMsResponse
    • GPUStockItem
    • GPUSpecsResponse
    • GetSupportedProtocolsResponse
    • GPUStocksResponse
    • GetVMAttachedFirewallsResponse
    • DeploymentData
    • DeleteAPIKeyResponse
    • GetVolumeTypesResponse
    • HibernateVMResponse
    • HibernationBillingMetrics
    • ListFirewallsResponse
    • ListUserVMsResponse
    • ListVMsResponse
    • DeploymentDataStatusEnum
    • ModelsResponse
    • GetSSHKeysResponse
    • Pagination
    • PricingRequest
    • OSImage
    • Deposit
    • PricingResponse
    • OSImagesResponse
    • DepositStatusEnum
    • Protocol
    • GpuCountEnum
    • FirewallInstance
    • ProtocolEnum
    • Image
    • GpuModelEnum
    • GetVolumeDetailsResponse
    • RebootVMResponse
    • ImageCreateResponse
    • RecentHibernation
    • ImageDeleteResponse
    • GetVolumesWithNextNameResponse
    • RemoveFirewallRuleResponse
    • ImageDetailResponse
    • RemoveVMSecurityRuleResponse
    • Region
    • ImageListResponse
    • ResizeVolumeRequest
    • RegionsResponse
    • Price
    • ResizeVolumeResponse
    • ResourceTypeEnum
    • RestoreSnapshotRequest
    • RestoreSnapshotResponse
    • GetSSHKeyDetailResponse
    • RestoreVMResponse
    • Snapshot
    • SnapshotImageRelationshipResponse
    • GetSnapshotDetailsResponse
    • Specs
    • StartVMResponse
    • GpuBilling
    • StopVMResponse
    • TierEnum
    • UpdateScriptRequest
    • UsageHistoryResponse
    • UsageSummaryResponse
    • RegionEnum
    • UserVM
    • VMDetailsResponse
    • VMFlavor
    • InstanceFeatures
    • VMImage
    • InstanceSpecs
    • VMInstance
    • IpStatusEnum
    • VMResponse
    • SpecsMetadata
    • VMSecurityRule
    • VMSecurityRuleRequest
    • VMStatus
    • VMVolumeAttachment
    • Script
    • ListFirewallInstancesResponse
    • VolumeTypeEnum
    • SSHKeyResponse
    • ScriptListResponse
    • OsVolume
    • ListSnapshotsResponse
    • ListVMsForSnapshotResponse
    • ListAPIKeysResponse
    • PricingRequestVolumeTypeEnum
    • ToggleVMPublicIPResponse
    • PatchedDeposit
    • PatchedTransaction
    • PaymentMethodEnum
    • VolumeBillingRecord
    • VolumeBillingSummary
    • VolumeHourlyBillingResponse
    • SecurityRule
    • ScriptCreateResponse
    • RestoreSnapshotData
    • ScriptDeleteResponse
    • ScriptDetailResponse
    • VolumeResponse
    • ScriptUpdateResponse
    • StatusEnum
    • StorageBilling
    • SnapshotBillingRecord
    • SnapshotBillingResponse
    • SnapshotBillingSummary
    • SnapshotDetail
    • SnapshotListItem
    • SnapshotVMResponse
    • Tier528Enum
    • TokenObtainPair
    • TokenRefresh
    • Transaction
    • VolumeCreate
    • TransactionTypeEnum
    • VolumeCreateVolumeTypeEnum
    • VolumeRate
    • UserProfile
    • VMDetailVolumeAttachment
    • VMOperations
    • VMSpecs
    • VolumeTypeItem
    • VolumeTypesByTier
  1. Billing

Credit Depletion & Resource Protection

Barrack AI uses per-minute billing for all resources. When your credit balance is depleted, a grace period system protects your resources and gives you time to add credits before any action is taken.

How Billing Works#

All resources — virtual machines, volumes, and snapshots — are billed every minute. The per-minute rate is calculated as:
per_minute_rate = hourly_rate / 60
Each minute, the billing service deducts the per-minute cost from your credit balance in your preferred currency (USD, EUR, or INR).

What Happens When Credits Run Out#

When your balance goes negative, your resources are not immediately deleted. Instead, a grace period begins.

Grace Period#

Your resources continue running while your balance is negative. Billing continues during this period, meaning your negative balance will increase over time.
The grace period ends — and all resources are permanently deleted — when either of the following thresholds is reached (whichever comes first):
ThresholdUSDEURINR
Balance cap-$10.00-€10.00-₹500.00
Time cap24 hours24 hours24 hours
Once either threshold is hit, all your active resources are terminated immediately and irreversibly.

Warning Emails#

Two warning emails are sent during the grace period:

Email 1 — Low Balance Warning#

Sent the moment your balance first goes negative. This email includes:
Your current negative balance
The number of active resources at risk (VMs, volumes, snapshots)
The termination thresholds (balance cap and time cap)
A link to add credits

Email 2 — Final Warning#

Sent when you are approximately 1 hour away from termination. This is triggered when either:
Your negative balance reaches 80% of the cap (-$8 / -€8 / -₹400), or
You have been in negative balance for 23 hours
This email explicitly states that your resources will be permanently deleted within the next hour if credits are not added.

Termination Order#

When a termination threshold is reached, resources are deleted in the following order:
1.
Virtual Machines — Deleted first (highest cost, stops billing accumulation fastest)
2.
Volumes — Deleted second
3.
Snapshots — Deleted last

What "Terminated" Means#

Virtual Machines: The instance is permanently destroyed. All data on the VM is lost and cannot be recovered.
Volumes: The storage volume is permanently deleted. All data stored on the volume is lost.
Snapshots: The snapshot is permanently deleted. It cannot be used to restore a VM.
This action is irreversible. Once resources are deleted due to credit depletion, they cannot be recovered.

How to Prevent Termination#

Add credits to your account before either threshold is reached. Once your balance returns to zero or above:
The grace period timer resets
All warning flags are cleared
No further warning emails are sent (until the next time your balance goes negative)
You can add credits at any time from your dashboard.

Summary#

EventWhat Happens
Balance reaches $0Billing continues, balance goes negative
Balance first goes negativeGrace period starts, Email 1 (warning) sent
Balance reaches -$8 / -€8 / -₹400 or 23 hours negativeEmail 2 (final warning) sent
Balance reaches -$10 / -€10 / -₹500 or 24 hours negativeAll resources permanently deleted
Credits added, balance returns to $0+Grace period resets, flags cleared
Previous
View Instances
Next
Add SSH Keys
Built with