---
title: "Get file cost estimate"
method: GET
path: "/files/{file_id}/cost-estimate"
tags: ["files"]
---

# Get file cost estimate

`GET /files/{file_id}/cost-estimate`

Estimate the cost of processing a batch file before creating a batch.

Returns a breakdown by model including estimated input/output tokens and cost. Useful for validating costs before committing to a batch run.

## Path parameters

- `file_id` string, required

## Query parameters

- `completion_window` string, nullable

## Response `200`

Cost estimate with per-model breakdown.

- FileCostEstimate — Response for file cost estimation
  - `file_id` string, required
  - `models` ModelCostBreakdown[], required — Per-model breakdown
    - `estimated_cost` string, required — Cost as string to preserve decimal precision
    - `estimated_input_tokens` integer, required
    - `estimated_output_tokens` integer, required
    - `model` string, required
    - `request_count` integer, required
  - `total_estimated_cost` string, required — Total cost as string to preserve decimal precision
  - `total_estimated_input_tokens` integer, required
  - `total_estimated_output_tokens` integer, required
  - `total_requests` integer, required

## Other responses

- `404` — File not found or you don't have access to it.
- `500` — An unexpected error occurred. Retry the request or contact support if the issue persists.

---

[API](https://skmtc.dev/doubleword/apis/doubleword-api.md) · [All operations](https://skmtc.dev/doubleword/apis/doubleword-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/doubleword/doubleword-api/revisions/6617202865d8/schema)
