Mobile apps: add Profile and daily usage/cost view backed by app-server APIs

Open 💬 1 comment Opened May 30, 2026 by tzarebczan

Summary

The new Codex mobile apps would benefit from a real Profile/Usage surface: auth state, account email, plan, rate-limit/credit status, and daily usage details. I could not find public Android/iOS/mobile app sources in openai/codex, so I opened a fork branch that adds the missing app-server support surface the mobile clients could consume.

Implementation branch: https://github.com/tzarebczan/codex/tree/codex/mobile-profile-usage
Commit: https://github.com/tzarebczan/codex/commit/9bb3674e15

Public repo finding

The public openai/codex repo appears to expose the app-server/protocol pieces, but not the Android/iOS app implementations. I checked GitHub repo search for OpenAI-owned codex android, codex ios, and codex mobile, and those returned no public repos.

Existing app-server surface

The app-server already has useful building blocks:

  • account/read: returns the current account and whether OpenAI auth is required.
  • account/rateLimits/read: returns current ChatGPT rate-limit and credit snapshots.
  • thread/tokenUsage/updated: streams/restores per-thread usage with total/last input, cached input, output, and reasoning output token counts.

What it does not appear to expose today is a daily account-level usage ledger with per-day input/output/cached/reasoning tokens and cost.

Branch implementation

The branch adds a narrow v2 JSON-RPC method:

{ "method": "account/profile/read", "params": { "refreshToken": false, "includeRateLimits": true } }

Response shape:

  • account
  • requiresOpenaiAuth
  • authMode
  • optional rateLimits
  • optional rateLimitsByLimitId
  • optional rateLimitsError

The rate-limit fetch is optional so a profile/settings UI can render local account identity quickly, and still show account state if the backend rate-limit request fails.

Files touched in the branch:

  • codex-rs/app-server-protocol/src/protocol/v2/account.rs
  • codex-rs/app-server-protocol/src/protocol/common.rs
  • generated app-server protocol JSON/TypeScript schema fixtures
  • codex-rs/app-server/src/request_processors/account_processor.rs
  • codex-rs/app-server/src/message_processor.rs
  • codex-rs/app-server/README.md
  • app-server integration tests for the new endpoint

Validation run locally on Windows:

  • just write-app-server-schema
  • cargo test -p codex-app-server-protocol
  • cargo test -p codex-app-server --test all get_account_profile -- --nocapture
  • just fix -p codex-app-server-protocol
  • just fix -p codex-app-server

just argument-comment-lint was blocked on this Windows checkout because the recipe expects Bazel and expands the path incorrectly under this shell. The targeted prebuilt wrapper also requires dotslash; the source wrapper works for codex-app-server-protocol, but codex-app-server is blocked by the pinned Dylint nightly (nightly-2025-09-18, rustc 1.92) versus sqlx@0.9.0 requiring rustc 1.94.

Requested mobile feature

A Profile screen or account drawer on mobile could show:

  • signed-in account email and auth mode
  • plan type
  • current Codex rate-limit windows and reset times
  • current credits / usage-limit status where available
  • today / last 7 days / last 30 days token usage
  • input, cached input, output, and reasoning output token breakdowns
  • daily cost, if the backend can provide actual or pricing-derived cost

The daily token/cost view likely needs backend support beyond the current /api/codex/usage / /wham/usage snapshot that the public backend client maps to rate-limit data.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗