Repository navigation
Analyze and moments pricing: one batched model request - #36
sidneyswift wants to merge 3 commits into
Conversation
recoupable/api#1233 runs full_report's 13 sections and song moments' descriptions as one batched model request each, so each pays the $0.05 base once. Updates the analyze and moments pricing paragraphs, the 402 gate amounts ($0.05 for full_report, $0.06 for moments with describe), the required_credits description and example, the full_report preset and elapsed_seconds descriptions, and the credits page. Regenerated manifest and llms-full.txt; refreshed the inventory hash (pin unchanged). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
recoupable/docs#36 rewrites the analyze/moments pricing and credits text; the shared fixture records those source hashes. Contract tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated with build-contract-examples.py against recoupable/api#1233, which carries the matching API fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins recoupable/api#1233 head (83b330fe). Re-pin to its merge commit after it merges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
3 issues found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="content/docs/source/llms-full.txt">
<violation number="1" location="content/docs/source/llms-full.txt:15746">
P2: The pricing text bills `full_report` for "the seconds of the sections that returned", but `elapsed_seconds` and the credits formula bill the whole wall time. State one billing basis and align the pricing paragraph, the OpenAPI description, and the credits table with it.</violation>
</file>
<file name="content/docs/source/credits.mdx">
<violation number="1" location="content/docs/source/credits.mdx:252">
P2: The credits summary still implies a model charge for each described moment, contradicting this corrected table’s single batched charge. Update the summary row to say `$0.05` once when descriptions are requested, plus aggregate inference time.</violation>
</file>
<file name="content/docs/source/api-reference/songs/moments.mdx">
<violation number="1" location="content/docs/source/api-reference/songs/moments.mdx:63">
P2: The new pricing says all moment descriptions share one batched model request, but `SongMomentsRequest.describe` still says each description is charged at the analyze rate. Update that schema description to document one base charge and aggregate inference time.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| ## Pricing | ||
|
|
||
| `$0.05` per model call plus `$0.001166` per second of inference time. `full_report` makes 13 calls, so its base prices add up to `$0.65`, plus the seconds each call ran. The balance must cover the base price of the request before the model runs; otherwise the response is `402` and nothing is charged. See [Credits](https://docs.recoupable.dev/credits). | ||
| `$0.05` per model request plus `$0.001166` per second of inference time. `full_report` asks all 13 sections in one batched request, so it pays the `$0.05` base once, plus the seconds of the sections that returned; a failed section costs nothing. The balance must cover the base price of the request before the model runs; otherwise the response is `402` and nothing is charged. See [Credits](https://docs.recoupable.dev/credits). |
There was a problem hiding this comment.
P2: The pricing text bills full_report for "the seconds of the sections that returned", but elapsed_seconds and the credits formula bill the whole wall time. State one billing basis and align the pricing paragraph, the OpenAPI description, and the credits table with it.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At content/docs/source/llms-full.txt, line 15746:
<comment>The pricing text bills `full_report` for "the seconds of the sections that returned", but `elapsed_seconds` and the credits formula bill the whole wall time. State one billing basis and align the pricing paragraph, the OpenAPI description, and the credits table with it.</comment>
<file context>
@@ -15743,7 +15743,7 @@ If every section fails, the response is `502` with `status: "error"`, `error: "M
## Pricing
-`$0.05` per model call plus `$0.001166` per second of inference time. `full_report` makes 13 calls, so its base prices add up to `$0.65`, plus the seconds each call ran. The balance must cover the base price of the request before the model runs; otherwise the response is `402` and nothing is charged. See [Credits](https://docs.recoupable.dev/credits).
+`$0.05` per model request plus `$0.001166` per second of inference time. `full_report` asks all 13 sections in one batched request, so it pays the `$0.05` base once, plus the seconds of the sections that returned; a failed section costs nothing. The balance must cover the base price of the request before the model runs; otherwise the response is `402` and nothing is charged. See [Credits](https://docs.recoupable.dev/credits).
## POST /api/songs/analyze
</file context>
| | [`POST /api/songs/analyze`](/api-reference/songs/analyze) | `$0.05 + $0.001166 × elapsed_seconds` per model request; `full_report` is one request | | ||
| | [`POST /api/songs/analyze/batch`](/api-reference/songs/analyze-batch) | `$0.05 + $0.001166 × elapsed_seconds` once per batch, `elapsed_seconds` being the whole batch | | ||
| | [`POST /api/songs/moments`](/api-reference/songs/moments) | `$0.01` per song measured, plus `$0.05 + $0.001166 × elapsed_seconds` per moment described | | ||
| | [`POST /api/songs/moments`](/api-reference/songs/moments) | `$0.01` per song measured, plus `$0.05 + $0.001166 × elapsed_seconds` once for the moments described | |
There was a problem hiding this comment.
P2: The credits summary still implies a model charge for each described moment, contradicting this corrected table’s single batched charge. Update the summary row to say $0.05 once when descriptions are requested, plus aggregate inference time.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At content/docs/source/credits.mdx, line 252:
<comment>The credits summary still implies a model charge for each described moment, contradicting this corrected table’s single batched charge. Update the summary row to say `$0.05` once when descriptions are requested, plus aggregate inference time.</comment>
<file context>
@@ -247,9 +247,9 @@ Current as of this revision of the page. The authoritative source is the per-end
+| [`POST /api/songs/analyze`](/api-reference/songs/analyze) | `$0.05 + $0.001166 × elapsed_seconds` per model request; `full_report` is one request |
| [`POST /api/songs/analyze/batch`](/api-reference/songs/analyze-batch) | `$0.05 + $0.001166 × elapsed_seconds` once per batch, `elapsed_seconds` being the whole batch |
-| [`POST /api/songs/moments`](/api-reference/songs/moments) | `$0.01` per song measured, plus `$0.05 + $0.001166 × elapsed_seconds` per moment described |
+| [`POST /api/songs/moments`](/api-reference/songs/moments) | `$0.01` per song measured, plus `$0.05 + $0.001166 × elapsed_seconds` once for the moments described |
## Billing recovery and units
</file context>
| ## Pricing | ||
|
|
||
| `$0.01` per song measured, plus the [analyze](/api-reference/songs/analyze) rate for each moment described: `$0.05` per model call plus `$0.001166` per second of inference time. The balance must hold `$0.01` plus `$0.05` for every moment that may be described before anything runs: `$0.36` with the default `describe: true`, `$0.01` with `describe: false`, and `$0.01` plus `$0.05` per type with a list. Otherwise the response is `402` and nothing is charged. A moment whose description fails comes back without a description and is not charged, and a failed measurement is not charged. See [Credits](/credits). | ||
| `$0.01` per song measured, plus one batched [analyze](/api-reference/songs/analyze) request for the moments described: `$0.05` once plus `$0.001166` per second of inference time. The balance must hold `$0.01`, plus `$0.05` when any moment may be described, before anything runs: `$0.06` with the default `describe: true` or a list of types, and `$0.01` with `describe: false` or an empty list. Otherwise the response is `402` and nothing is charged. A moment the model does not describe comes back without a description and is not charged, and a failed measurement is not charged. See [Credits](/credits). |
There was a problem hiding this comment.
P2: The new pricing says all moment descriptions share one batched model request, but SongMomentsRequest.describe still says each description is charged at the analyze rate. Update that schema description to document one base charge and aggregate inference time.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At content/docs/source/api-reference/songs/moments.mdx, line 63:
<comment>The new pricing says all moment descriptions share one batched model request, but `SongMomentsRequest.describe` still says each description is charged at the analyze rate. Update that schema description to document one base charge and aggregate inference time.</comment>
<file context>
@@ -60,4 +60,4 @@ Store `measured_with` with every result. It changes whenever the measurement's r
## Pricing
-`$0.01` per song measured, plus the [analyze](/api-reference/songs/analyze) rate for each moment described: `$0.05` per model call plus `$0.001166` per second of inference time. The balance must hold `$0.01` plus `$0.05` for every moment that may be described before anything runs: `$0.36` with the default `describe: true`, `$0.01` with `describe: false`, and `$0.01` plus `$0.05` per type with a list. Otherwise the response is `402` and nothing is charged. A moment whose description fails comes back without a description and is not charged, and a failed measurement is not charged. See [Credits](/credits).
+`$0.01` per song measured, plus one batched [analyze](/api-reference/songs/analyze) request for the moments described: `$0.05` once plus `$0.001166` per second of inference time. The balance must hold `$0.01`, plus `$0.05` when any moment may be described, before anything runs: `$0.06` with the default `describe: true` or a list of types, and `$0.01` with `describe: false` or an empty list. Otherwise the response is `402` and nothing is charged. A moment the model does not describe comes back without a description and is not charged, and a failed measurement is not charged. See [Credits](/credits).
</file context>
There was a problem hiding this comment.
2 existing issues remain and no new issues found across 8 files
Requires human review: Auto-approval blocked because this review re-detected 2 unresolved issues already reported by Cubic.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="content/docs/source/llms-full.txt">
<violation number="1" location="content/docs/source/llms-full.txt:663">
P2: The new detailed row says song moments share one model base charge, but the billing summary still says the rate applies to each moment. Update the summary row too, including its source in `credits.mdx`.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| | [`POST /api/songs/analyze`](https://docs.recoupable.dev/api-reference/songs/analyze) | `$0.05 + $0.001166 × elapsed_seconds` per model request; `full_report` is one request | | ||
| | [`POST /api/songs/analyze/batch`](https://docs.recoupable.dev/api-reference/songs/analyze-batch) | `$0.05 + $0.001166 × elapsed_seconds` once per batch, `elapsed_seconds` being the whole batch | | ||
| | [`POST /api/songs/moments`](https://docs.recoupable.dev/api-reference/songs/moments) | `$0.01` per song measured, plus `$0.05 + $0.001166 × elapsed_seconds` per moment described | | ||
| | [`POST /api/songs/moments`](https://docs.recoupable.dev/api-reference/songs/moments) | `$0.01` per song measured, plus `$0.05 + $0.001166 × elapsed_seconds` once for the moments described | |
There was a problem hiding this comment.
P2: The new detailed row says song moments share one model base charge, but the billing summary still says the rate applies to each moment. Update the summary row too, including its source in credits.mdx.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At content/docs/source/llms-full.txt, line 663:
<comment>The new detailed row says song moments share one model base charge, but the billing summary still says the rate applies to each moment. Update the summary row too, including its source in `credits.mdx`.</comment>
<file context>
@@ -658,9 +658,9 @@ Current as of this revision of the page. The authoritative source is the per-end
+| [`POST /api/songs/analyze`](https://docs.recoupable.dev/api-reference/songs/analyze) | `$0.05 + $0.001166 × elapsed_seconds` per model request; `full_report` is one request |
| [`POST /api/songs/analyze/batch`](https://docs.recoupable.dev/api-reference/songs/analyze-batch) | `$0.05 + $0.001166 × elapsed_seconds` once per batch, `elapsed_seconds` being the whole batch |
-| [`POST /api/songs/moments`](https://docs.recoupable.dev/api-reference/songs/moments) | `$0.01` per song measured, plus `$0.05 + $0.001166 × elapsed_seconds` per moment described |
+| [`POST /api/songs/moments`](https://docs.recoupable.dev/api-reference/songs/moments) | `$0.01` per song measured, plus `$0.05 + $0.001166 × elapsed_seconds` once for the moments described |
## Billing recovery and units
</file context>
What changes
recoupable/api#1233 runs
full_report's 13 sections, and song moments' descriptions, as one batched model request each. Each pays the$0.05base once instead of once per call.full_reportbase$0.65(13 calls)$0.05+ seconds of sections that returnedfull_report402 gate$0.65$0.05$0.36$0.06($0.01measurement +$0.05)Edited:
required_credits60000),required_creditsdescription,full_reportpreset andelapsed_secondsdescriptions ("one batched request", "one after another"),Also regenerated
manifest.jsonandllms-full.txt, and refreshed the inventory hash.apiSourceCommitis unchanged.Order
This describes behavior that goes live when api#1233 merges. Merge that first, then this. After both merge, re-pin
apiSourceCommitto the api#1233 merge commit, as #35 did for batch and moments.Checks
pnpm docs:build,pnpm docs:check,pnpm test(145),pnpm type-check,pnpm lint, andrefresh-contract-inventory.py --checkagainst the pinned API revision all pass.🤖 Generated with Claude Code
Summary by cubic
Updates the docs to match recoupable/api#1233, where
full_report's 13 sections and song moments' descriptions now run as one batched model request, paying the$0.05base once.full_report's 402 gate drops from$0.65to$0.05; moments' gate drops from$0.36to$0.06.required_creditsexample (60000), therequired_creditsdescription, thefull_reportpreset andelapsed_secondsdescriptions, and the credits page.example-cases.jsonviabuild-contract-examples.py, regeneratedmanifest.jsonandllms-full.txt, and pinnedapiSourceCommitto the head of api#1233.Merge api#1233 first; after it lands, re-pin
apiSourceCommitto its merge commit.Written for commit 034de80. Summary will update on new commits.