Skip to content

Analyze and moments pricing: one batched model request - #36

Open
sidneyswift wants to merge 3 commits into
mainfrom
codex/batch-pricing
Open

sidneyswift wants to merge 3 commits into
mainfrom
codex/batch-pricing

Conversation

@sidneyswift

@sidneyswift sidneyswift commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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.05 base once instead of once per call.

Was Now
full_report base $0.65 (13 calls) $0.05 + seconds of sections that returned
full_report 402 gate $0.65 $0.05
Moments (describe) gate $0.36 $0.06 ($0.01 measurement + $0.05)

Edited:

  • the analyze and moments pricing paragraphs (OpenAPI and reference pages),
  • both 402 descriptions, plus the moments 402 example (required_credits 60000),
  • the required_credits description,
  • the full_report preset and elapsed_seconds descriptions ("one batched request", "one after another"),
  • the credits page.

Also regenerated manifest.json and llms-full.txt, and refreshed the inventory hash. apiSourceCommit is unchanged.

Order

This describes behavior that goes live when api#1233 merges. Merge that first, then this. After both merge, re-pin apiSourceCommit to 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, and refresh-contract-inventory.py --check against 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.05 base once.

  • full_report's 402 gate drops from $0.65 to $0.05; moments' gate drops from $0.36 to $0.06.
  • Covers the analyze and moments pricing paragraphs, the 402 descriptions and the moments required_credits example (60000), the required_credits description, the full_report preset and elapsed_seconds descriptions, and the credits page.
  • Refreshed example-cases.json via build-contract-examples.py, regenerated manifest.json and llms-full.txt, and pinned apiSourceCommit to the head of api#1233.

Merge api#1233 first; after it lands, re-pin apiSourceCommit to its merge commit.

Written for commit 034de80. Summary will update on new commits.

View guided diff Turn on auto-fix

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>
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 5, 2026 6:17am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dd6396cc-1dcb-478b-8253-cc2e57204627
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

sidneyswift added a commit to recoupable/api that referenced this pull request Nov 5, 2026
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>
sidneyswift and others added 2 commits November 5, 2026 01:16
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>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant