---
title: "Estimate a task's credit cost"
method: GET
path: "/tasks/cost_estimate"
tags: ["Tasks"]
---

# Estimate a task's credit cost

`GET /tasks/cost_estimate`

## Request

- Base URL: `https://api.crevio.co/v1`
- URL: `https://api.crevio.co/v1/tasks/cost_estimate`
- Auth: API key in header `Authorization`

Estimate what a scheduled task costs before you create or change it, and whether the credit balance still lasts until the next refill with it running. Pass `task_id` to price an existing task (any schedule field you also pass overrides the task's), or describe a new one with `trigger_type` and its schedule. `credits_per_run` is the median of the task's own recent completed runs, else of the account's tasks on the same model, else a typical agent run (`basis` says which). Runs per day come from the cron expression or interval; for an event trigger pass `runs_per_day`, or `task_id` to use the task's observed rate. `burn_rate_per_day`, `runs_out_at` and `runs_out_before_refill` describe the account with the task running at that rate (an active `task_id` replaces its own recent spend rather than adding to it). A condition script that skips runs makes the real cost lower.

## Query parameters

- `task_id` string
- `trigger_type` 'cron' | 'interval' | 'once' | 'immediate' | 'event'
- `cron_expression` string
- `timezone` string
- `interval_seconds` integer
- `runs_per_day` number
- `model_id` string
- `kind` 'agent' | 'script'

## Response `200`

Cost estimate

- TaskCostEstimate
  - `object` string, required
  - `runs_per_day` number, nullable, required
  - `credits_per_run` number, required
  - `basis` 'task_history' | 'account_history' | 'typical', required
  - `sample_runs` number, required
  - `credits_per_day` number, nullable, required
  - `credits_per_month` number, nullable, required
  - `balance` number, required
  - `burn_rate_per_day` number, required
  - `refills_at` string, nullable, required
  - `runs_out_at` string, nullable, required
  - `runs_out_before_refill` boolean, required
  - `auto_top_up` boolean, required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `429`: Rate limit exceeded — 600 requests per minute per credential. Retry after the number of seconds in `Retry-After`.
- `500`: Internal server error

---

[API](https://skmtc.dev/crevio/apis/crevio-api-v1.md) · [All operations](https://skmtc.dev/crevio/apis/crevio-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/crevio/apis/crevio-api-v1/revisions/2219f18ad651?raw)
