Skip to content

Commit d511782

Browse files
committed
docs: Add --estimate-cost feature documentation and bump version to 0.1.26
- Add --estimate-cost CLI example in Command Line Usage section - Add comprehensive Cost Estimation section explaining 3-tier scenarios - Document Conservative (P50), Average (Mean), Worst Case (P95) ratios - Update CHANGELOG.md with v0.1.26 release notes - Bump version in pyproject.toml from 0.1.25 to 0.1.26
1 parent 1658493 commit d511782

File tree

3 files changed

+63
-1
lines changed

3 files changed

+63
-1
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ All notable changes to APIAS (API Auto Scraper) will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.1.26] - 2025-12-02
9+
10+
### New Features
11+
- Add `--estimate-cost` CLI flag for cost estimation before processing by @Emasoft
12+
- Add 3-tier cost estimation: Conservative (P50), Average (Mean), Worst Case (P95) by @Emasoft
13+
- Add model comparison display showing costs across all supported models by @Emasoft
14+
- Add interactive menu after cost estimation (proceed/change model/exit) by @Emasoft
15+
16+
### Configuration
17+
- Add COST_RATIO_CONSERVATIVE, COST_RATIO_AVERAGE, COST_RATIO_WORST_CASE constants by @Emasoft
18+
- Add MODEL_PRICING dictionary with per-model input/output costs per 1M tokens by @Emasoft
19+
- Add estimate_tokens(), estimate_cost(), get_cost_estimates() functions in config.py by @Emasoft
20+
21+
### Testing
22+
- Add TestCostEstimation class with 8 new tests for cost estimation functions by @Emasoft
23+
24+
### Documentation
25+
- Add --estimate-cost usage example to README Command Line Usage section by @Emasoft
26+
- Add comprehensive Cost Estimation section in README explaining scenarios by @Emasoft
27+
828
## [0.1.25] - 2025-12-02
929

1030
### DRY Principle Compliance (Terminal Utilities)

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ apias --url https://example.com --mode batch
7777
# Limit how many pages to scrape
7878
apias --url https://example.com --mode batch --limit 50
7979

80+
# Estimate costs before processing (no API calls made)
81+
apias --url https://example.com --mode batch --estimate-cost
82+
8083
# Use a configuration file
8184
apias --url https://example.com --config apias_config.yaml
8285
```
@@ -225,6 +228,45 @@ limit: 100
225228

226229
---
227230

231+
#### `--estimate-cost` - Preview API Costs Before Processing
232+
233+
Before committing to a full extraction, you can estimate costs without making any OpenAI API calls:
234+
235+
```bash
236+
apias --url https://example.com --mode batch --estimate-cost
237+
```
238+
239+
This will:
240+
1. Scrape all pages (respecting `--limit` if set)
241+
2. Calculate total input tokens from page content
242+
3. Display three cost scenarios based on real-world usage data:
243+
244+
```
245+
┌─────────────────────────────────────────────────────────────┐
246+
│ Cost Estimation │
247+
├─────────────────────────────────────────────────────────────┤
248+
│ Input Tokens: 1,234,567 │
249+
├─────────────────────────────────────────────────────────────┤
250+
│ Scenario │ Output Tokens │ Input Cost │ Total Cost │
251+
├─────────────────┼───────────────┼────────────┼──────────────┤
252+
│ Conservative │ 716,249 │ $0.06 │ $0.35 │
253+
│ Average │ 2,271,603 │ $0.06 │ $0.97 │
254+
│ Worst Case │ 14,592,582 │ $0.06 │ $5.90 │
255+
└─────────────────────────────────────────────────────────────┘
256+
```
257+
258+
**Cost Scenarios Explained:**
259+
260+
| Scenario | Output Ratio | Description |
261+
|----------|-------------|-------------|
262+
| **Conservative** | 0.58x input | P50 median - half of jobs cost this or less |
263+
| **Average** | 1.84x input | Mean across all extractions |
264+
| **Worst Case** | 11.82x input | P95 - only 5% of jobs exceed this |
265+
266+
> **Tip**: The Conservative estimate is typically accurate for well-structured API documentation. Use the Worst Case estimate for budget planning with complex or messy HTML.
267+
268+
---
269+
228270
### Quick Reference: Common Configurations
229271

230272
#### For Small Websites (< 50 pages)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "apias"
7-
version = "0.1.25"
7+
version = "0.1.26"
88
description = "AI powered API documentation scraper and converter"
99
readme = "README.md"
1010
requires-python = ">=3.10"

0 commit comments

Comments
 (0)