Skip to content

[Console v2] /console/api/request-logs: 503 ServiceUnavailable above ~20-50 page size, /request-logs/export always 503 — and the legacy per-key /usage/rows endpoint is gone #51806

Closed as not planned

Description

@Steve233333

Summary

Two regressions in the Console v2 usage/logs API, plus one retired endpoint that third-party usage dashboards depended on:

  1. GET /console/api/request-logs returns 503 ServiceUnavailable as soon as the page size goes above ~20–50 (the threshold drifts during the day).
  2. GET /console/api/request-logs/export returns 503 ServiceUnavailable every time.
  3. The legacy GET /console/api/usage/rows (which returned one row per request with costMicroCents + model + serviceApiKeyId) now 404s for every query, which removed the only way to break usage down per API key.

Reproduced from a normal user session (Go subscription, signed-in Console cookies), no VPN, macOS.

Environment

  • Client: custom usage dashboard; auth via Console cookies (auth, __Host-console_session) + x-org-id header (same as the Console web app).
  • Region: China Mobile (CN) — but see "healthy endpoints" below, this does not look like a network issue.
  • Date: 2026-09-28, 16:33 UTC+8.

Repro A — page size threshold on /usage/request-logs

Same time window for every call (today 00:00 → +24h, UTC+8):

limit HTTP items
5 200 5
10 200 10
20 200 20
50 503 0
100 503 0
curl 'https://opencode.ai/console/api/request-logs?limit=100&since=<ms>&until=<ms>' \
  -H 'Cookie: auth=…; __Host-console_session=…' -H 'x-org-id: <redacted>'
# → HTTP 503 {"_tag":"ServiceUnavailable"}

Note the threshold is not stable: earlier the same day limit=20 also returned 503 while limit=10 worked; at 16:33 limit=20 worked and limit=50 did not. Looks like a server-side cost/timeout guard rather than a hard limit.

Repro B — export endpoint

curl 'https://opencode.ai/console/api/request-logs/export?format=json&since=<ms>&until=<ms>' -H 'Cookie: …' -H 'x-org-id: <redacted>'
# → HTTP 503 {"_tag":"ServiceUnavailable"}   (every attempt, incl. a single day)

Repro C — legacy per-key endpoint is gone

curl 'https://opencode.ai/console/api/usage/rows?range=30d&pageSize=100' -H 'Cookie: …' -H 'x-org-id: <redacted>'  # → 404
curl 'https://opencode.ai/console/api/usage/rows?range=7d'                                                          # → 404

That endpoint used to be the only one carrying serviceApiKeyId per request, i.e. the only way to show cost/tokens per API key. request-logs carries serviceAPIKeyID too, but it is (a) currently unusable beyond ~20 rows per page, and (b) has no data older than ~Sept 19 for this workspace, while usage/cost-by-day has 30+ days.

Healthy endpoints (same minute, same cookies)

usage/summary, usage/cost-by-day (day + bucket=hour), usage/models (incl. since=…), usage/users, service-accounts — all 200 in 0.8–3.6 s. So the problem is isolated to the two logs endpoints.

Questions / asks

  1. Can request-logs accept normal page sizes (100, as used by the Console's own Logs page) again — or is there a documented max?
  2. Can request-logs/export be fixed? It is the only practical way to pull a day/batch without hundreds of small pages.
  3. Is the legacy /usage/rows coming back? If not, could the per-key dimension be exposed somewhere cheaper, e.g. usage/models?groupBy=service_api_key, a serviceAPIKeyID column in usage/cost-by-day, or a scope in v2/usage/export? Right now there is no endpoint that returns per-key totals for a 30-day window.

Related reports (other projects adapting to the Console v2 migration)

(Account identifiers intentionally redacted; happy to provide workspace/service-account IDs privately if a maintainer needs them.)

Activity

  1. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Please use the Bug Report template and put the report in its required Description field. The current body uses Summary instead, so the required Description field is missing.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions