Paid calls
calls/README.md
# Paid calls Claude Code makes no paid call before a row exists for it in this table. The Service of a row is the name of its call log, `<service>-calls.csv`: `typesafe` is the TypeSafe JEV API (D111), `openai` is the OpenAI Decisions API, `openrouter` is OpenRouter (D188), and `gemini` is the Decisions API of Gemini (D301). | Date | Service | Purpose | Max calls | Max cost (USD) | Approved by | |---|---|---|---|---|---| | 2026-10-20 | typesafe | All JEV calls of the study, within the free credit for a new user (D44); calls left under the 7,000-call cap of D26 | 2446 | 5 | fmm | | 2026-10-21 | typesafe | Fair comparison: description loops, checks, calibration and test runs (design X17, D84) | 50000 | 20 | fmm | | 2026-10-23 | typesafe | Package decisions (M3), Task 2: real responses of each question type (noul, choice, score) and of an image request, for the tests of the package (D188) | 400 | 9.5 | fmm | | 2026-10-23 | openai | Package decisions (M3), Task 2: the same with the OpenAI Decisions API (gpt-6-luna) (D188) | 400 | 9.5 | fmm | | 2026-10-23 | openrouter | Package decisions (M3), Task 2: the same with Jev and Microsoft-Decision-1 through OpenRouter (D188) | 400 | 9.5 | fmm | | 2026-10-23 | typesafe | Package decisions (M3), Task 11: saved results of vignettes 1 to 4 and 6 (D191) | 300 | 1 | fmm | | 2026-10-23 | openai | Package decisions (M3), Task 11: the same with the OpenAI Decisions API (D191) | 300 | 1 | fmm | | 2026-10-23 | openrouter | Package decisions (M3), Task 11: Jev and Microsoft-Decision-1 through OpenRouter for vignette 3 (D191) | 150 | 0.5 | fmm | | 2026-10-23 | typesafe | Package decisions (M3), Task 12: vignette 5 repeats the study with Jev (grid, rescoring of the loop wordings, calibration, one test) (D191) | 8000 | 5 | fmm | | 2026-10-23 | openai | Package decisions (M3), Task 12: the same with gpt-6-luna (D191) | 8000 | 10 | fmm | | 2026-10-25 | typesafe | Space decisions (M6): smoke test and the gate on the private Space (D244) | 1000 | 0.05 | fmm | | 2026-10-26 | typesafe-space | Space decisions (M6): the calls of visitors on the public Space, for each month (D227, D251). The app stops at USD 0.25 for each visit, USD 2 each day and USD 20 each month. It limits the cost, not the number of calls. Max calls is USD 20 at 8,253 tokens for each image call. | 57700 | 20 | fmm | | 2026-10-28 | typesafe | Box study (M7), pilot with jev-1.14.0: the input tokens of one image at several sizes, the form of the Box answer, and the first Box answers on FabriD, tank screw and pipe clip (D269) | 2000 | 1 | fmm | | 2026-10-28 | typesafe | Box study (M7): the search for an agentic strategy (plans/2026-10-28-box-agentic-plan.md): answer bank and live runs on the development sets, the frozen strategy on the test sets (D278) | 6000 | 3 | fmm | | 2026-10-29 | elevenlabs | Space decisions (M6): the narration of the demo video, at most 20,000 characters (D282). Max cost is 20,000 characters at USD 0.10 for each 1,000 characters, the API list price of Multilingual v2. The characters come from the plan of fmm. Max calls is the limit of Claude Code for the requests. | 200 | 2 | fmm | | 2026-10-29 | typesafe | Space decisions (M6): the runs of the demo video on the public Space, an upload of pipe staple images and a score question on text (D285) | 300 | 0.1 | fmm | | 2026-11-24 | gemini | Package decisions: tests of the Decisions API of Gemini (gemini-decision-1): the request format, images and references, real responses for the tests of the package, and the runs of the vignettes, as for gpt-6-luna (D301, D302) | 30000 | 15 | fmm | | 2026-11-24 | typesafe | Box in decisions (D307): strategies T and Z of D303 on the textile images of the package, to decide if Box goes into version 0.2.0 | 400 | 0.1 | fmm | | 2026-11-24 | typesafe | locate() in decisions (D321): the run of the vignette section on the 46 textile inputs, and the fixture calls of the tests | 150 | 0.05 | fmm | | 2026-11-25 | typesafe | Box study (M7), test (D335 to D337): locate() and the two older strategies (top-down with Box, and one Box on the whole image) on the one-time test sets of FabriD, tank screw and pipe clip, and on one held-out AutoVI class | 6000 | 20 | fmm | | 2026-11-25 | typesafe | Box study (M7), pixel study (D340 to D344): pure-Jev and hybrid map methods on the development pool (223 images; cap 5,000 calls and USD 4, prefix box px dev) and one final test after the go of fmm (cap 7,000 calls and USD 6, prefix box px final) | 12000 | 10 | fmm | | 2026-11-27 | typesafe | Box study (M7), pixel study, the confirmatory test of the refined map (D351 to D353): locate(), the TTA request and the gate of TTA_vote_G1 on 514 fresh images of 4 datasets, once (prefix box px confirm; at most USD 0.01 for each image) | 3000 | 2 | fmm | ## Call logs Each service has one log: `<service>-calls.csv`. The columns are: `time_utc,call_id,purpose,model,request_id,status,latency_ms,input_tokens,output_tokens,cost_usd` The log of `typesafe-space` is different. The Space keeps no log of single calls. It keeps one row for each day in `usage.csv` of the private dataset `fmegahed/decisions-space-usage`: date, calls, input tokens and cost. Claude Code copies these rows into the record at the end of M6 and in each later session about the Space. The rows start on the day the Space is public; the calls before that day are under D244. The file `typesafe-space-calls.csv` does not exist yet: the site of the record counts one row of a log as one call, so a row for each day needs a change of the record tools first (open). The log of `elevenlabs` holds one row for each request of speech. The column `input_tokens` holds the characters of the request, `output_tokens` is 0, and `cost_usd` is the characters times USD 0.00008 (the API price of Eleven v4, D286). A request that failed has 0 characters. ## Paid calls before the record The record started after the experiments (D7). The paid calls before it were approved in the chat, not in this table. There is no per-call log for them (open item O2). - Service: TypeSafe JEV API (`jev-1.13.0`). Calls made: 4,554, on 2026-10-20. - Approvals in the chat: batch 1 with 600 calls (D4), a cap of 1,000 calls (D10), a cap of 5,000 calls (D16), and a cap of 7,000 calls (D26). - Estimated cost: about USD 0.52 (12.3 million input tokens at USD 0.042 per million). The estimate multiplies the calls of each batch by the input tokens measured for that kind of request. These calls count against the USD 5 budget above, so about USD 4.48 remains. - Clef-Flash (D34) and CLIP ran on a local GPU. They had no API cost. ## Paid calls after the budget row - 2026-10-20, about 18:40 UTC: 100 JEV calls, made by mistake. A test of a new guard in `scripts/optimize_jev.R` was meant to stop before any call, but Rscript reloaded the key from `.Renviron`. The run used the default microstructure settings, so it repeated the baseline (BA 0.54, AUC 0.789, against 0.55 and 0.803). Estimated cost: about USD 0.011. There is no per-call log (open item O2). - Totals: 4,654 JEV calls, about USD 0.53. Left under the budget row: 2,346 calls and about USD 4.47. ## Calls of the fair comparison Budget row of 2026-10-21 (D84). Each call has a row in `typesafe-calls.csv`. The cost is an estimate: input tokens times USD 0.042 per million. | Step | Purpose prefix | Calls | Failed | Input tokens | Estimated cost (USD) | |---|---|---|---|---|---| | Checks before the loops | fair check | 4 | 0 | 6,448 | 0.0003 | | Description loops (design set) | fair design | 1,248 | 0 | 2,422,368 | 0.10 | | Calibration runs (set C) | fair calibration | 1,170 | 0 | 2,292,808 | 0.10 | | Test runs (one time) | fair test | 6,012 | 0 | 12,622,200 | 0.53 | | Total | | 8,434 | 0 | 17,343,824 | 0.73 | - Left under the budget row: 41,566 calls and about USD 19.27. - Clef-Flash and CLIP ran on a local GPU. They had no API cost. ## Calls of the Space gate Budget row of 2026-10-25 (D244). The Space counts its own calls in the private dataset `fmegahed/decisions-space-usage` (file `usage.csv`, one row for each day). It does not write `typesafe-calls.csv`. The cost is an estimate: input tokens times USD 0.042 per million. | Step | Calls | Input tokens | Estimated cost (USD) | |---|---|---|---| | Smoke test (`tests/live_smoke.R`, rows in `typesafe-calls.csv`) | 2 | 8,724 | 0.0004 | | Tests of fmm on the private Space (`usage.csv`, 2026-10-25) | 177 | 877,933 | 0.0369 | | Total | 179 | 886,657 | 0.0372 | - Left under the budget row: 821 calls and about USD 0.013. - At about 21:45 UTC, the usage page of TypeSafe showed 8,822 tokens for the day, about the smoke test alone. The page has a delay. - On 2026-10-26 at about 00:18 UTC, the usage page of the key `huggingface-decisions` showed 179 requests, 886,657 input tokens and USD 0.0372. These numbers are the same as the table above. The estimate of the app (input tokens times USD 0.042 per million) is the same as the spend of TypeSafe. - The balance of the TypeSafe account was USD 21.12. The account has no card (D241), so the balance is a hard limit for all calls of the account. ## Calls of the Box study Budget row of 2026-10-28 (D269): USD 1 and 2,000 calls, model `jev-1.14.0`. Each call has a row in `typesafe-calls.csv` (purpose prefix `box pilot`). The cost is an estimate: input tokens times USD 0.042 per million. | Step | Calls | Failed | Input tokens | Estimated cost (USD) | |---|---|---|---|---| | Image tokens: one tank screw image at 5 sizes, first try | 5 | 5 | 0 | 0 | | Image tokens: the same, second try | 5 | 0 | 10,344 | 0.0004 | | Box answers on 3 FabriD test images | 3 | 0 | 3,547 | 0.0001 | | Spike of the region scan (D275), 20 images: direct requests | 22 | 0 | 30,155 | 0.0013 | | Spike: scans of the regions | 36 | 2 | 688,335 | 0.0289 | | Spike: a Box in the kept regions | 20 | 0 | 44,690 | 0.0019 | | Spike round 2 with reference images (D276): direct requests | 20 | 0 | 100,763 | 0.0042 | | Spike round 2: scans of the regions | 35 | 0 | 774,249 | 0.0325 | | Spike round 2: a Box in the kept regions | 20 | 0 | 87,712 | 0.0037 | | Round 3, top-down search (D277): Noul of the regions, one request for each size | 160 | 0 | 954,781 | 0.0401 | | Round 3: a Box in the final regions | 20 | 0 | 63,526 | 0.0027 | | Total | 346 | 7 | 2,758,102 | 0.1158 | - The first try failed with HTTP 400 "Invalid image request": the base64 text of the script had line breaks (`jsonlite::base64_enc()` adds them). The responses report no input tokens. The second try removed the line breaks, as the package decisions does. - Image tokens: input tokens = 353 + 0.00253 x pixels (5 sizes, 280 to 1176 px high). One token is about 395 pixels. An image of 280 x 280 px is about 200 tokens; the largest image (2,458,624 px) is about 6,200 tokens. - The spike failed twice before it ran: a scan without a `state` (HTTP 422, "Field required") and a scan of about 44,000 tokens (HTTP 400, "max_tokens_exceeded"). Neither reports input tokens. A scan of 33,155 tokens passed, so the spike sends the regions in requests of about 30,000 tokens. Two direct requests ran twice, because the first image was saved only at its end. - Both rounds of the spike have the purpose prefix `box spike`: the first round ran from 02:54 to 02:56 UTC, round 2 from 03:14 to 03:16 UTC (2026-10-28). - Round 3 has the purpose prefix `box topdown` (04:02 to 04:04 UTC, 2026-10-28). - Left under the budget row: 1,654 calls and about USD 0.884. ### Calls of the search for an agentic strategy Budget row of 2026-10-28 (D278): USD 3 and 6,000 calls. Purpose prefix `box bank` for stage 1 (the answer bank of the development set, 65 images; 04:17 to 04:31 UTC, 2026-10-28). | Step | Calls | Failed | Input tokens | Estimated cost (USD) | |---|---|---|---|---| | W0 and W1: questions on the whole image, without and with references | 130 | 0 | 411,301 | 0.0173 | | G2: Box on 4 crops of 80% | 65 | 0 | 306,693 | 0.0129 | | G3: Choice over tiles, two levels | 122 | 0 | 586,794 | 0.0246 | | G4: Noul of the regions (5 sizes, and 3 deeper sizes below the yes regions) | 264 | 0 | 3,480,138 | 0.1462 | | V1, R1 and R2: Noul, Box and edge Nouls for each candidate | 146 | 31 | 2,256,337 | 0.0948 | | V4: Choice among the 5 best candidates | 65 | 0 | 254,694 | 0.0107 | | Total of stage 1 | 792 | 31 | 7,295,957 | 0.3064 | - The 31 failed calls (HTTP 400 "Invalid image dimensions") had a crop of a thin candidate box that cannot have both sides in 280 to 1568 px. They report no input tokens. The crops now are at most 5.5 times as long as wide, and the second run asked only the missing questions. - Left under the budget row of D278: 5,208 calls and about USD 2.694. ### Calls of the check of D303 Budget row of 2026-10-28 (D278). A subagent (Fable) made these calls on 2026-11-24, from 19:20 to 19:51 UTC, with a cap of 1,500 calls and USD 0.50. Purpose prefix `box d303`. All calls used the 65 images of the development set; no call used a test image. | Step | Calls | Failed | Input tokens | Estimated cost (USD) | |---|---|---|---|---| | Version probe: the aliases and four unknown model IDs (HTTP 400) | 7 | 4 | 864 | 0.0000 | | Repeat of the request W0 of 2026-10-28, twice on 15 images | 30 | 0 | 44,780 | 0.0018 | | Box on the whole image, at native size and enlarged | 130 | 0 | 465,294 | 0.0195 | | Box in crops of 3 and 6 times the true defect, at two sizes, without and with references | 250 | 0 | 921,587 | 0.0388 | | Tiles then Box: Choice over 9 tiles, Box, Noul check, and a second Box in the crop | 325 | 0 | 2,993,749 | 0.1257 | | Noul of the regions at 768 px | 45 | 0 | 827,497 | 0.0348 | | Occlusion of tiles, and a picture as the Box target | 55 | 0 | 475,705 | 0.0200 | | Agent runs of the strategies T and Z, and the Noul check | 316 | 0 | 1,880,475 | 0.0791 | | Total | 1,158 | 4 | 7,609,951 | 0.3196 | - Left under the budget row of D278: 4,050 calls and about USD 2.374. ### Calls of the Box test on the textiles (D307) Budget row of 2026-11-24 (D307): USD 0.10 and 400 calls, model `jev-1.14.0`. Purpose prefix `box d307`. Claude Code made the calls on 2026-11-24, from 21:30 to 21:32 UTC, on the 46 textile inputs of decisions, with the inputs that fmm accepted (D315). | Step | Calls | Failed | Input tokens | Estimated cost (USD) | |---|---|---|---|---| | T1: Choice over 9 tiles with the reference crops | 92 | 46 | 475,277 | 0.0200 | | T2: Box in the two best tiles, with two wordings | 15 | 0 | 208,384 | 0.0088 | | Z1: Noul and Box on the whole image at 1568 px | 46 | 0 | 303,644 | 0.0128 | | Z2: Box in a crop of 3 times the Z1 box | 46 | 0 | 117,546 | 0.0049 | | Total | 199 | 46 | 1,104,851 | 0.0464 | - The 46 failed calls (HTTP 403, "Must supply an API key") came from a first run whose script did not load the key. They report no tokens and cost nothing. The script now loads the key and checks it, and the second run answered every call. - Left under the budget row of D307: 201 calls and about USD 0.054. ### Calls of locate() in decisions (D321) Budget row of 2026-11-24 (D321): USD 0.05 and 150 calls, model `jev-1.14.0`. Purpose prefix `decisions-0.2.0-locate-`. Claude Code made the calls on 2026-11-25, from 00:52 to 01:02 UTC. Two calls made the test fixtures (`probe_locate()`). Then `locate()` ran on the 46 textile inputs of the package (`case_images_locate()`). | Run | Step | Calls | Failed | Input tokens | Estimated cost (USD) | |---|---|---|---|---|---| | Fixtures | 1: Choice over 9 tiles | 1 | 0 | 10,259 | 0.0004 | | Fixtures | 2: Box in the two best tiles | 1 | 0 | 13,857 | 0.0006 | | Images | 1: Choice over 9 tiles | 46 | 0 | 471,914 | 0.0198 | | Images | 2: Box in the two best tiles | 16 | 0 | 221,712 | 0.0093 | | Total | | 64 | 0 | 717,742 | 0.0301 | - The script of the images run logs one row for each request. It stops before call 93 (`with_logged_calls()` in `data-raw/vignette_results.R`). - Left under the budget row of D321: 86 calls and about USD 0.020. ### Calls of the Box test on FabriD and AutoVI (D335) Budget row of 2026-11-25 (D335): USD 20 and 6,000 calls, model `jev-1.14.0`; the plan capped the work at USD 2 and 3,000 calls. Purpose prefix `box d336`. Claude Code made the calls on 2026-11-25: two smoke runs on 4 images that are not test images (16:20 and 16:43 UTC), then the test run on the 158 test images (16:44 to 16:52 UTC). | Run | Strategy | Calls | Failed | Input tokens | Estimated cost (USD) | |---|---|---|---|---|---| | Smoke (2 runs) | L, locate() | 16 | 0 | 182,200 | 0.0077 | | Smoke (2 runs) | TD, top-down with Box | 58 | 0 | 241,051 | 0.0101 | | Smoke (2 runs) | Z, one Box on the whole image | 8 | 0 | 46,516 | 0.0020 | | Test | L, locate() | 287 | 0 | 3,220,401 | 0.1353 | | Test | TD, top-down with Box | 1,033 | 0 | 4,787,252 | 0.2011 | | Test | Z, one Box on the whole image | 158 | 0 | 911,750 | 0.0383 | | Total | | 1,560 | 0 | 9,389,170 | 0.3943 | - Left under the budget row of D335: 4,440 calls and about USD 19.61. ## Calls of the Gemini Decisions API (D301) Budget row of 2026-11-24 (D301): USD 15 and 30,000 calls, model `gemini-decision-1`. The cost is an estimate: input tokens times USD 0.10 per million. Gemini reports none. | Step | Purpose prefix | Calls | Failed | Input tokens | Estimated cost (USD) | |---|---|---|---|---|---| | Spike: the request format (2026-11-24) | `decisions-gemini-probe` | 8 | 1 (on purpose) | 5,377 | 0.0005 | | Package, part 1: fixtures of the tests | `decisions-0.2.0-gemini-` | 9 | 1 (on purpose) | 4,448 | 0.0005 | | Package, part 2: vignette "Choosing a model" (75 injury reports) | `decisions-0.2.0-choosing-a-model` | 75 | 0 | 17,346 | 0.0017 | | Package, part 2: vignette "Images" (46 textiles, with and without references) | `decisions-0.2.0-images` | 92 | 0 | 314,686 | 0.0315 | | Package, part 3: the four description loops of the case study | `decisions-0.2.0-gemini-loop-` | 1,728 | 0 | 9,839,136 | 0.9839 | | Package, part 3: case study, run 1: grid | `decisions-0.2.0-study-grid-` | 2,280 | 0 | 14,604,280 | 1.4604 | | Package, part 3: case study, run 1: calibration | `decisions-0.2.0-study-calibration-` | 202 | 0 | 1,692,398 | 0.1692 | | Package, part 3: case study, run 1: the one-time test | `decisions-0.2.0-study-test-` | 1,029 | 3 | 8,944,794 | 0.8945 | | Package, part 3: one debug call of the refused test image | `decisions-0.2.0-study-debug` | 1 | 1 | 0 | 0.0000 | | Package, part 3: the rerun of D311 (wording, grid, calibration, test) | `decisions-0.2.0-study-rerun-` | 5,237 | 1 | 35,080,608 | 3.5081 | - The fixture calls of part 1 hold one row added by hand: the logger failed on the first call (`usage$input_tokens` matched `input_tokens_by_modality`), and the call was made again. - Venn calls are local and free; they are not logged. - The failed calls of part 3 are one extrusion test image (`extrusion_images/over/frame351.jpg`) that the safety filter of Gemini refused each time (HTTP 400, `prohibited_content`): the test, two sends of the failed row, one debug call, and the test of the rerun. The case study keeps it as a row with an error. - Total of the budget row of D301 on 2026-11-24: 10,661 calls, about USD 7.05 of USD 15. ## Rule Do not put a key, a token or an authorization header in any file in this folder. ## Calls of the Space video Budget rows of 2026-10-29 (D282, D285). The runs go through the public Space, so the Space counts them in `usage.csv` of `fmegahed/decisions-space-usage` (2026-10-29). They are not in `typesafe-calls.csv`. The numbers are the stats line of the app after each run. The cost is an estimate: input tokens times USD 0.042 per million. | Take (UTC) | Run | Calls | Answers | Estimated cost (USD) | |---|---|---|---|---| | 2026-10-29T17:20Z, upload, take 1 | Try on 5 | 5 | AUC 1.00, accuracy 1.00 | 0.002 | | 2026-10-29T17:20Z, upload, take 1 | Run all | 16 | AUC 1.00, accuracy 1.00 | 0.006 | | 2026-10-29T17:22Z, text Score | Run all | 6 | no labels | 0.000 | | 2026-10-29T18:17Z, upload, take 2 | Try on 5 | 5 | AUC 1.00, accuracy 1.00 | 0.002 | | 2026-10-29T18:17Z, upload, take 2 | Run all | 16 | AUC 1.00, accuracy 1.00 | 0.006 | | Total | | 48 | | 0.016 | - Take 2 replaced take 1, because the screen of take 1 did not show the answers while the narration named them. The video uses take 2. - The probabilities of Jev changed a little between the takes: the missing staples got 0.58 to 0.69 in take 1 and 0.56 to 0.67 in take 2. The order did not change. - Left under the budget row of D285: 252 calls and about USD 0.084. - ElevenLabs (D282): see `elevenlabs-calls.csv`. Left under the cap: about 15,400 characters.