# Billing
source: https://docs.chalk.ai/docs/billing

## How Chalk bills each kind of workload, and how to reduce your costs.

Chalk bills two kinds of workloads in different ways:

- Context: billed by the uptime of the nodes that run your features, queries, and branches
- Runtime and Learning: billed per second for the resources each container requests,
such as a sandbox, a function, or a training job

This page explains what is billed and when. For current rates, see Pricing.

### Context

Chalk bills Context workloads for the uptime of nodes labeled Chalk Managed. A node's cost is:

```
hourly rate for the node's instance type × hours the node is up
```

Chalk meters uptime in 1-second increments. The cost of a node does not depend on its load: queries, features, and
branches running on a node that is already up add no cost.

### Finding Context rates

To see the hourly rate for each instance type, go to Settings > Usage > Utilization Rates in the
dashboard, or run chalk usage rates:

```
$ chalk usage rates
```

These rates apply to Context workloads only. For Runtime and Learning rates, see
Pricing.

### Reducing Context costs

- Shut down the branch server when it is idle. The branch server shuts down after a period with no requests,
which stops its costs. The default period is 1 hour. To change it, go to
Infrastructure > Resource Configuration > Branch Server and set Auto Shutdown Period. See
Auto-shutdown. The branch server starts again when you run
chalk apply --branch or chalk query --branch, use ChalkClient, or use the dashboard. Queries sent over gRPC
do not start it. See Start and stop the branch server.
- Size and scale the other servers. In Infrastructure > Resource Configuration, choose the instance type for
each server and set a scaling policy that removes nodes when traffic is low. Choose an instance type with enough
capacity for the resource request times the maximum number of instances, plus overhead.

### Context FAQ

### Am I charged per pod or per node?

Per node. Running more Chalk pods on a node does not change its cost.

### Do more branches cost more money?

No. One pod runs all branches.

### Am I charged when a node is up but nobody is querying?

Yes. A node costs the same whether or not it serves traffic. To reduce idle cost, set an auto-shutdown period for the
branch server and a scaling policy for the other servers.

### What if non-Chalk workloads run on the same cluster?

Chalk charges only for nodes labeled Chalk Managed. Workloads on other nodes add no Chalk charges. To keep unrelated
workloads off Chalk-managed nodes, use isolated or restricted nodepools.

### What do these labels in the nodepool configuration pane mean?

Nodepool labels in the dashboard

- Chalk: the nodepool's nodes are Chalk-managed, and their uptime is billed. Nodepools created in the Chalk dashboard
have this label.
- Isolated: workloads schedule on the nodepool's nodes only if they set the nodepool in their Resources settings.
Set it with Isolate this nodepool.
- Restricted: only Chalk workloads can schedule on the nodepool's nodes, so unrelated workloads do not add to its
usage. Set it with Restrict to Chalk workloads only.

Chalk workloads schedule only on nodepools with the Chalk label. They schedule on an Isolated nodepool only when
configured to.

### Does Chalk charge for storage or for stopped environments?

No. For Context workloads, Chalk charges only for running nodes. An environment whose nodes are shut down, such as an
idle staging environment, adds no cost.

### Runtime and Learning

Chalk bills Runtime and Learning workloads by the second, for each container:

| What is billed | How                                                                           |
| -------------- | ----------------------------------------------------------------------------- |
| CPU and memory | Per vCPU-second and per GiB-second of the CPU and memory a container requests |
| GPUs           | Per GPU-second, at the rate for the GPU type                                  |
| Volumes        | Per GiB per month                                                             |
| Network egress | Per GiB                                                                       |

A container is billed from the second it reports Ready until the second it exits. Pulling its image, initializing GPU
drivers, and downloading a model before it is Ready are not billed. A container that uses GPUs is also billed for its
CPU and memory.

There is no minimum charge, minimum duration, or per-request fee. Partial seconds are prorated.

### Scaling groups and autoscaling

Each replica of a scaling group is billed from Ready until it is removed, whether or
not it serves traffic. The minimum replica count sets your idle cost: with min_replicas=0, the group scales to zero
when traffic stops, and the first request after that waits for a replica to start. Replicas added during a burst are
billed only until they scale down. See Autoscaling.

### Training

A training job is billed the same way: per GPU-second from Ready to exit, plus its CPU and memory. Checkpoint storage
is billed separately.

### Committed-use pricing

For committed or reserved pricing, for Context or for Runtime and Learning, contact your Chalk representative.
Reserved Runtime and Learning capacity is also metered per second.

### Marketplace billing

Chalk supports billing for Context usage through the AWS and GCP marketplaces. For Runtime and Learning usage,
contact your Chalk representative. With marketplace billing, your Chalk usage appears as a line item on your
cloud provider bill. To set it up, contact your Chalk representative, who coordinates a private offer with Chalk's
finance team. You then pay your Chalk charges through
AWS Marketplace or
GCP Marketplace.

Depending on your agreement, marketplace billing can use:

- Prepaid bundles, invoiced up front.
- Usage-based billing, invoiced monthly in arrears. For example, April usage appears on your April cloud provider
bill.




