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

## Learn about Chalk's billing model and how to optimize costs.

Chalk charges for machine uptime of nodes labeled as Chalk Managed. We calculate this by
multiplying:

- The instance type
- Chalk’s credit utilization rate/hour for that instance type
- The number of hours (i.e., uptime) that the node remains active.
Rather than rounding to the nearest hour, Chalk meters usage in 10-second increments.

Regardless of the load placed on a Chalk-managed node, credit usage remains the same.
We charge for the node’s uptime, not based on the level of activity within the node.
You can run unlimited queries or create multiple branches without incurring extra charges.
Billing is based solely on the node’s active hours, not on how many features or branches are used.

### Finding Chalk Credit Rates

You can see the full list of credit utilization rates per hour for all machine types in the Chalk
dashboard under Settings > Usage > Utilization Rates.

To view the full list of credit utilization rates in your terminal, log into Chalk in the
terminal and use the Chalk CLI command to view usage rates.

```
$ chalk login
$ chalk usage rates
```

### Cost Optimization Tips

There are two primary ways to optimize your resource configurations for cost optimization.

### Configure Auto-Shutdown Periods

The branch server can be configured to automatically shut down after a window of inactivity. To set this
window of inactivity, go to Infrastructure > Resource Configuration > Branch Server in the dashboard.
After the specified window of inactivity, the server automatically shuts down, halting costs. If the
branch server is shut down and activity is detected, including branch deployments and queries, then the
branch server will automatically spin back up.

### Configure Resource Configurations

For the other nodes in your cluster, you can configure the resource configurations according to your needs
in the dashboard under Infrastructure > Resource Configuration. You can select the instance type
for each server that is right for you, and set a scaling policy that ensures that you scale up when traffic
is high, but notably that your nodes scale down when traffic is low. The instance type selected should have
enough capacity to support the resource request multiplied by the number of max instances, plus additional overhead.

### Frequently Asked Questions

### Do I get charged for pods or for nodes?

You are charged per node. Multiple Chalk pods on a single node does not change the amount of the credit
utilization.

### What if we are running non-Chalk workloads on the same cluster?

Chalk only applies charges to nodes labeled “Chalk Managed.” Other workloads on different nodes do not
incur Chalk charges. You can also configure your cluster to have isolated nodepools to ensure that
unrelated workloads are completely isolated from your Chalk Managed nodes.

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

You may notice labels like Chalk, Restricted, and Isolated in the nodepools settings pane.

Different nodepool labels

- Chalk: This label indicates that the nodepool makes Chalk-managed nodes, whose uptime contributes to credit usage. All nodepools
created through the Chalk dashboard automatically have this label, although the dashboard will also display nodepools without it.
- Isolated: This label indicates that the nodepool will not allow any workloads to schedule on its nodes
unless they are explicitly configured to do so by setting the Nodepool field in the Resources settings pane. Controlled by the checkbox
"Isolate this nodepool".
- Restricted: This label indicates that the nodepool makes nodes that only allow Chalk workloads to schedule on them. This is
useful in the case where Chalk is running in your cluster alongside other unrelated workloads, and it prevents those workloads from
inadvertently consuming Chalk credits. Controlled by the checkbox "Restrict to Chalk workloads only".

Chalk workloads are only allowed to schedule on nodes from nodepools with the Chalk label. They will not schedule on an Isolated nodepool
unless configured to do so, and the Restricted label has no effect on whether Chalk workloads can schedule on the nodepool, but only affects
unrelated non-Chalk workloads.

### Do more branches cost more money?

No. Because one pod runs all branches, there is no extra cost for having multiple branches.

### Do I get charged if nobody is running queries but the node is still up?

Yes, if the node is up, you are accumulating costs. You can mitigate this by setting the auto-shutdown
period for the branch server for periods of inactivity, as well as by configuring a scaling policy for
your other workloads.

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

Chalk only charges for compute resources (i.e., running nodes). If a staging environment is idle or shut
down, it won’t incur costs.

### Chalk Marketplace Billing

Chalk supports marketplace billing through both AWS and GCP. With this setup, your Chalk usage is billed directly to
your cloud infrastructure provider, appearing as a line item on your existing bill and simplifying your payment process.

If you’re interested in enabling marketplace billing, reach out to your Chalk representative. Our finance team will guide
you through the required steps and coordinate a private offer. Once finalized, you’ll be able to receive and pay
your Chalk charges directly through
AWS Marketplace or
GCP Marketplace.

Depending on your Chalk agreement, we can accommodate:

- Prepaid bundles, invoiced up front.
- Standard usage-based billing, invoiced monthly in arrears. For example, your April Chalk usage will appear on
your April cloud provider bill.

The benefits of marketplace billing include:

- No extra invoices to manage
- Chalk charges consolidated with your existing infrastructure spend
- Available on both AWS and GCP




