> ## Documentation Index
> Fetch the complete documentation index at: https://docs.together.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Pricing

> Estimate post-training GPU costs and see how per-minute billing, refunds on failure, and the minimum credit balance work.

Post-training bills for the GPUs you reserve for training, not for the tokens you process. You pay per GPU-minute from the moment a model resource becomes ready until it stops, even while no session is training on it. This page explains how billing works, how to estimate costs, and what happens when a resource fails or your credit runs out.

## How billing works

A model resource bills by the minute only while its status is `READY`. You aren't billed while it waits for capacity, starts up, or shuts down.

A resource's hourly rate is the per-GPU-hour price for its GPU type multiplied by the number of GPUs it holds. For current per-GPU-hour prices, see the [Together AI pricing page](https://www.together.ai/pricing).

The GPU count depends on the base model, the GPU type, the number of generator replicas, and whether the resource trains a low-rank adapter (LoRA) or full weights. A trainer-only resource (`num_generator_replicas=0`) costs less per minute than the same resource with a generator. A LoRA resource can need fewer trainer GPUs than a full-weight one.

Sessions are free, whether they're training or idle. The number of sessions doesn't change a resource's rate, so training several adapters on one resource costs the same per minute as training one. A resource with no sessions still bills until it stops.

> [!WARNING]
>
> A resource keeps billing after your training script exits unless the script stops it. Cookbook recipes stop the resources they create when they exit. If you provision a resource yourself, use `ModelResourcesClient` as a context manager so the resource stops on exit, or [stop the resource](https://docs.together.ai/docs/post-training/model-resources.md#stop-a-resource) when you're done. When you use the context manager, nest the session's context manager inside the resource's so the session stops first. Left running, an idle resource stops on its own only after its [idle timeout](https://docs.together.ai/docs/post-training/model-resources.md#idle-timeout) (one hour by default), and that idle time is billed.

## Estimate the cost of a resource

To see what a resource costs per hour before you create it, call `estimate_cost` with the configuration you plan to use. It returns the on-demand hourly price without provisioning anything:

```python theme={null}
from together import Together

client = Together()

estimate = client.post_training.model_resources.estimate_cost(
    base_model="Qwen/Qwen3.8-27B",
    compute_config={"gpu_type": "B200-SXM", "num_generator_replicas": 1},
    lora_enabled=True,
)
print(f"{estimate.price_per_hour:.2f} {estimate.currency}/hour")
```

You should see output like this:

```text theme={null}
88.00 USD/hour
```

On `B200-SXM`, this configuration uses four trainer GPUs and four GPUs for one generator replica. At \$11 per GPU-hour, that's \$88 per hour. Without the generator (`num_generator_replicas=0`), the same resource uses four GPUs and costs half as much. For the current rate, rely on the price `estimate_cost` returns rather than this example.

The Together AI console shows the same hourly price as **Rate** on each model resource's detail page under [Post-Training](https://api.together.ai/post-training/resources).

## Estimate the cost of a training run

To estimate what a full run costs, estimate how long its resource stays `READY`, then multiply by the hourly price:

1. Work out the total number of optimizer steps. For a cookbook recipe, the count depends on the training method:
   * **Group relative policy optimization (GRPO):** Use `num_steps` if you set it. Otherwise, divide the number of training examples by `batch_size` and multiply by `num_epochs`. Multi-turn GRPO recipes run one pass over the data, so don't multiply by `num_epochs`.
   * **Supervised fine-tuning (SFT):** Divide the number of training examples by `batch_size` and multiply by `num_epochs`, capping the result at `max_steps` if you set it.
   * **Direct preference optimization (DPO):** Use `max_steps`.
2. Launch a short test run with the same model, GPU type, generator count, batch size, group size, and sequence lengths as the planned run.
3. Time a few steady-state steps. Skip the first step, because its time includes one-time warm-up. For GRPO recipes, read `timing/step_total_s` from the run's `metrics.jsonl`. For SFT and DPO, take the difference between adjacent `elapsed_s` values.
4. Multiply the steady-state step time by the step count, then add the time for session startup, the first step's warm-up, validation passes, checkpoint saves, and any time the resource sits idle before you stop it. Convert the total to hours and multiply by the hourly price. Don't count the time before the resource is `READY`, because it isn't billed.

When several sessions share one resource, estimate the resource's cost once, from the total time it's `READY`, and divide it among the runs. Don't apply the full hourly price to each session.

## Refunds on failure

If a resource fails after reaching `READY` (`READY` → `ERROR`), Together AI refunds a trailing window of its runtime: the last three hours for a LoRA resource, or the last six hours for a full-weight resource. If the resource was ready for less time than that, the refund covers all of it.

A resource that fails before reaching `READY` (with `CAPACITY_WAIT_TIMEOUT` or `PROVISIONING_FAILED`) was never billed, so there's nothing to refund.

On long runs, save a [training checkpoint](https://docs.together.ai/docs/post-training/checkpoints.md#training-checkpoints) at least once per refund window, for example by setting the cookbook's `training_checkpoint_interval` (in steps). That way, the refund covers all the runtime since your last checkpoint.

## Minimum credit balance

Creating a model resource requires enough credit to run it for four hours at its [hourly rate](#estimate-the-cost-of-a-resource). Your credit is your project's balance plus any credit limit. For example, the \$88-per-hour resource in that section needs \$352, and the same resource without a generator replica needs \$176. For another configuration, multiply the `price_per_hour` that `estimate_cost` returns by four. The check runs only at creation, and billing still covers only the time the resource is `READY`.

If your credit can't cover four hours, the create request fails with HTTP `402` (`insufficient_balance`) and the message `project balance cannot cover 4 hours of this model resource`, before anything is provisioned. Add credits under [Billing](https://api.together.ai/settings/organization/~current/billing) in the console and retry, or lower the hourly rate with fewer generator replicas, LoRA instead of full-weight training, or a smaller base model. A blocked organization gets HTTP `403` (`blocked_user_error`).

Once a resource is running, the four-hour minimum no longer applies. Together AI checks your credit about once a minute and starts shutting down the resource when your balance goes past your credit limit or your organization is blocked. Shutdown can take longer than a minute, and the resource's sessions end when it stops. Save training checkpoints on long runs so an unexpected stop costs you one checkpoint interval instead of the whole run.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.