Skip to content
Prev Previous commit
docs: clarify native cost pagination stop
  • Loading branch information
ibetitsmike committed Aug 4, 2026
commit fb6c996f891133089f21a194e9375c189f33a825

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As a total aside, I was confused when I tried to search for "usage insights" in the docs, and I had to go to manifest.json to figure out that the page's title is actually "Spend management" now. Should we rename and redirect this page? Is "Spend management" closer to what we want to convey for this page? If so, the URL should also be updated.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Accepted the rename in 533779f7cf8: the page is now spend-management.md, and the manifest plus all in-repo links use the new path. The public redirect from the old URL must be added to coder/coder.com's redirects.json, so I am leaving this thread open until that companion change lands.\n\n> Mux applied this feedback on Mike's behalf.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Nick, could you add the companion redirect in coder/coder.com? The coder/coder rename and link updates are already pushed.

{"source":"/docs/ai-coder/agents/platform-controls/usage-insights","destination":"/docs/ai-coder/agents/platform-controls/spend-management","permanent":true}

Mux posted this request on Mike's behalf.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done — companion redirect is up in coder/coder.com#1001, and I've added you as reviewer there. It adds the permanent /docs/ai-coder/agents/platform-controls/usage-insights → /docs/ai-coder/agents/platform-controls/spend-management redirect.

I flagged on that PR that it should not merge until this one lands, so we don't redirect the still-live page to a path that doesn't exist yet. Leaving this thread open until both merge.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ $1,000,000 per member per period.
> Configured per-model prices and historical native cost totals are also not migrated to AI Gateway.
> Before upgrading, record any per-model prices you need from **Admin settings** > **AI** > **Models**.
> The old cost endpoints default `start_date` to 30 days before the request and `end_date` to the request time, so choose explicit RFC 3339 UTC values that cover all history you need.
> Fetch `/api/experimental/chats/cost/users?start_date=<start>&end_date=<end>&limit=100&offset=0`, save the response, and increase `offset` by 100 until it reaches the response `count`.
> Fetch `/api/experimental/chats/cost/users?start_date=<start>&end_date=<end>&limit=100&offset=0` and save the response.
> After each page, stop when `offset + users.length >= count`; otherwise, increase `offset` by 100 and fetch the next page.
> For every `users[].user_id` across those pages, save `/api/experimental/chats/cost/{user_id}/summary?start_date=<start>&end_date=<end>` with the same dates.
> Each summary contains the user's totals plus `by_model` and `by_chat` breakdowns.
> After upgrading, the native **Spend** page, per-model pricing fields, and aggregate cost endpoints are unavailable.
Expand Down
Loading