Skip to main content
Apidly Cloud
Cookie policy

Analytics and ad cookies stay off unless you accept. Cookie policy

We would like to use Google Analytics and Microsoft Clarity to understand how the public pages are used, including page views and session recordings, and the Reddit Pixel to measure whether our ads on Reddit lead to visits and sign-ups. You choose here whether they are on. Rejecting changes nothing about how the site works.

Check the price before you launch

Ask what a server would cost per hour, and whether it would start today, without creating anything: from the CLI, the API or an SDK.

Last updated November 23, 20263 min read
View as Markdown

Before a script starts a GPU server, it can ask what that server would cost and whether the request would be accepted today. This is a dry run: every check of a real request runs, but nothing is created, charged or recorded. It is free. You need the apidly command (see Use the CLI and API from scratch) and an API key with Servers or Full access.

1. Run a dry run from the CLI

Write the deploy command you would run, and add --dry-run:

apidly plans --available --sort price --limit 5
apidly deploy --plan PLAN_SLUG --template pytorch --disk 40 --label price-check --dry-run

The first command lists plans you can request now; copy a SLUG. The second asks no question and starts nothing.

2. Read the answer

You see lines like these, with today's prices:

Plan:      1x GPU_MODEL (PLAN_SLUG)
Template:  TEMPLATE_NAME (pytorch)
Disk:      40 GB
Running:   $… per hour ($… compute + $… disk)
Stopped:   $… per hour for the disk, until you destroy the server
The request passes every check.
Nothing was created. Run the same command without --dry-run to deploy.
  • Running is what the server costs per hour while it runs: compute plus disk.
  • Stopped is what is still charged while it is stopped: the disk only, until you destroy the server.
  • With --fallback-plan, an At most line shows the highest hourly price if a fallback plan is used.

3. Read the blockers

Instead of The request passes every check., you may see Would be refused today: followed by one line per problem, each with a code and what to do:

  • insufficient_balance: your balance is too low for this server. Add credit on Billing.
  • budget_reached: your organization's monthly budget is used up. Raise or remove it under Settings.
  • key_limit_reached: this API key has reached its own monthly spending limit.

A blocker does not hide the price, so you can see the cost even before you add credit. A request that could never work, for example an unknown plan, a disk size out of range or a plan that is out of stock, is not a blocker: the command stops with the error, just as a real deploy would.

4. The same through the API

Send the body of a real request to POST /api/v1/servers with ?dryRun=1. Use the id values of GET /api/v1/plans and GET /api/v1/templates:

curl -X POST "https://apidly.com/api/v1/servers?dryRun=1" \
  -H "Authorization: Bearer $APIDLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"planId": "PLAN_ID", "templateId": "TEMPLATE_ID", "label": "price-check", "diskGb": 40}'

The answer is 200 with "dryRun": true and a quote: totalHourlyUsd (running), hourlyPriceUsd (compute), storageHourlyUsd (disk), balanceUsd, requiredBalanceUsd and blockers, a list of code and message. An empty blockers list means a real request would pass. Dry runs have their own limit of 30 a minute per key, so they never use up your launch allowance.

5. The same from an SDK

JavaScript:

import { Apidly } from "@apidly/sdk";

const apidly = new Apidly({ apiKey: process.env.APIDLY_API_KEY });
const { quote } = await apidly.servers.estimate({
  planId: "PLAN_ID",
  templateId: "TEMPLATE_ID",
  label: "price-check",
  diskGb: 40,
});
if (quote.blockers.length > 0) {
  console.log(quote.blockers.map((b) => b.message).join("\n"));
} else {
  console.log(`About ${quote.totalHourlyUsd} USD per hour while running`);
}

Python:

import os
from apidly import Client

client = Client(api_key=os.environ["APIDLY_API_KEY"])
quote = client.servers.estimate(
    plan_id="PLAN_ID", template_id="TEMPLATE_ID", label="price-check", disk_gb=40
)["quote"]
print(quote["totalHourlyUsd"], [b["code"] for b in quote["blockers"]])

What it costs and how to stop spending

A dry run costs nothing and starts nothing, so there is nothing to stop. When you deploy for real, the server is charged from the moment it runs. Stop it with apidly stop ins_ID (the disk is still charged) or destroy it with apidly destroy ins_ID to end every charge.

Next

Ready to try it?

Create a free account and add credit when you want to start a server. The smallest top-up is $10.

Create a free account

Was this helpful?

Still stuck? Contact us