Skip to content

OpenAI account monthly remaining usage keeps decreasing even configured custom poviders, cannot trace usage via logs #3070

Description

@Tao-Yida

Client or integration

OpenCodex dashboard

Area

Proxy and routing

Summary

Although I have set all tasks handled by my custom model providers, my openai monthly remaining amount still goes down.
Furthermore, I have found that my usage of openai account mostly consists of gpt-5.6-terra, which I have not configured in any task.
Even for websearch function which I cannot configure custom models I use Luna not Terra, and I cannot trace when and where Terra was used.
Toggling intercepted requests doesn't filter the requests by Terra, only Luna.
I also suggest that logging mechanism should be able to filter by provider/model, and trace those more-shadow-like requests that consumed my limit but didn't show up in my logs

Reproduction

  1. Configure any custom providers.
  2. Use Codex as usual.
  3. Find monthly remaining usage goes down silently.
  4. Check logs but cannot find any request with gpt-5.6-terra.

Version

2.35.0

Operating system

CentOS7

Provider and model

openai/gpt-5.6-terra

Logs or error output

Screenshots and supporting files

Image

Redacted configuration

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    proxyHTTP proxy, routing, reverse-proxy / management auth
    on Aug 31, 2026
  2. github-actions commented on Aug 31, 2026

    @github-actions
    Contributor

    Issue reopened

    The report now contains the information required by the automated check. Thanks for updating it.

  3. lidge-jun commented on Aug 31, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 55 / 80

    이 이슈는 “일을 전부 커스텀 공급자로 보냈는데도 OpenAI 계정 월 잔량이 줄어든다”는 이야기다. 사용자는 2.35.0 / CentOS7 이고, OpenAI 쪽 사용량 대부분이 gpt-5.6-terra 인데 그 모델을 작업에 고른 적이 없다고 한다. 웹 검색은 Luna를 쓰고, 로그에서 가로채기(intercepted) 토글을 켜도 Terra는 안 보이고 Luna만 보인다. Terra가 언제 쓰였는지 로그로 못 따라가겠다는 요청과, 공급자/모델로 로그를 거르자는 제안이 같이 들어 있다. 지금 dev HEAD는 7ee96b94e(#3058, 패키지 2.38.0)이다. types.ts/config.ts 분할과 무관하다. 미리보기 배포는 계획에 없다.

    대시보드의 월 잔량은 프록시 로그를 더한 값이 아니다. gui/src/codex-quota-utils.ts의 monthlyPercent(6행)와 src/codex/auth-api.ts quotaForPlan(247행, 255행)은 ChatGPT/Codex 계정이 알려 주는 사용량 창을 그대로 보여 준다. 커스텀 공급자로 나간 턴은 이 숫자를 안 깎는다. 이 숫자가 줄어든다는 것은, 그 OpenAI 계정으로 네이티브 호출이 실제로 나갔다는 뜻이다. 스크린샷의 Terra 비중은 OpenAI 계정 사용량이지 OpenCodex 로그 합계가 아니다.

    Terra가 어디서 나오는지 HEAD가 분명히 말해 준다. src/codex/catalog/native-models.ts 5–8행 ACCOUNT_GATED_NATIVE_OPENAI_MODELS에 gpt-5.6-sol / gpt-5.6-terra / gpt-5.6-luna가 계정 네이티브 모델로 박혀 있다. Codex 앱의 기본 본 작업 모델이 Terra다. 커스텀 공급자 라우팅은 요청 모델이 라우트된 id이거나, 라우터가 그 이름을 커스텀 쪽으로 보낼 때만 탄다. 앱이 본 작업·압축에 맨이름 gpt-5.6-terra를 보내면 src/server/responses/compact.ts 506행처럼 일반 턴과 같은 routeModel을 타고 네이티브 openai로 간다. 별도 compact 공급자 키는 HEAD에 없다. 그게 열린 #2901이다.

    가로채기 토글이 Terra를 안 보여주는 것도 버그처럼 보이지만, HEAD 계약이다. src/lib/shadow-call.ts DEFAULT_SHADOW_SOURCE_MODELS(10행)는 gpt-5.6-luna뿐이다. 예전 클라이언트의 gpt-5.4-mini는 주석(src/types/config.ts 437행)에만 남아 있고 기본값에는 없다. Terra는 도우미 모델이 아니라 본 작업/압축 모델이라 이 목록에 없다. 로그 페이지 gui/src/pages/Logs.tsx 511–514행의 intercepted 필터는 shadowCallRewrittenFrom이 있는 줄만 남긴다. Luna 도우미를 가로채면 그 줄만 보이고, Terra 네이티브 턴은 이 토글에 안 걸린다. 꺼 둔 상태의 전체 로그에는 Terra 줄이 있을 수 있다. 표면 필터는 claude/codex/grok뿐이고, 공급자/모델 텍스트 필터는 없다(gui/src/pages/logs-surface-filter.ts 7행).

    웹 검색이 Luna인 것도 같은 그림이다. Codex 0.145+ 도우미 호출이 Luna이고, 가로채기가 켜져 있으면 그 Luna만 커스텀으로 바뀐다. 본 작업과 압축이 Terra로 남아 있으면 OpenAI 월 잔량은 Terra로 깎인다. HEAD에는 blockedModelRedirects(#2854)가 있다. 기본값은 비어 있고, 설정에 gpt-5.6-terra를 쓰는 커스텀 모델로 바꿔 달라는 맵을 넣으면 공유 라우터에서 Terra를 바꿔 준다(src/lib/shadow-call.ts resolveBlockedModelRedirect 19행). 사용 버전 2.35.0에는 이 키가 없을 수 있다. 2.38.0으로 올린 뒤에야 쓸 수 있다.

    그래서 이 이슈는 “커스텀으로 보낸 트래픽이 몰래 OpenAI를 깎는다”기보다, Codex가 아직 Terra 맨이름을 보내는 길(본 작업 기본값, 압축, 가로채기 밖 도우미)이 열려 있고, 로그가 그 길을 모델 기준으로 못 보여 주는 쪽에 가깝다. 설정 JSON과 로그 한 줄(코딩 턴의 model / resolvedModel / routeDecision)이 없으면 본 작업이 진짜로 커스텀을 타는지 여기서 닫을 수 없다. 로그 필터 제안은 기능 요청이고, 월 잔량 감소는 네이티브 호출이 있다는 신호다.

    경로 src/lib/shadow-call.ts 10행 DEFAULT_SHADOW_SOURCE_MODELS - 기본 가로채기는 Luna뿐이다. Terra는 안 걸린다. 토글이 Terra를 안 보여주는 이유다
    경로 gui/src/pages/Logs.tsx 511행 - intercepted 필터는 shadowCallRewrittenFrom이 있는 줄만 남긴다. 모델/공급자 텍스트 필터는 없다
    경로 src/server/responses/compact.ts 506행 - 압축이 일반 턴과 같은 routeModel을 쓴다. 앱이 Terra를 보내면 네이티브 openai로 간다. compact 공급자 키는 HEAD에 없다(#2901)
    경로 gui/src/codex-quota-utils.ts 6행 / src/codex/auth-api.ts 255행 - 월 잔량은 ChatGPT 계정 사용량 API다. 프록시 로그 합계가 아니다
    경로 src/lib/shadow-call.ts 19행 blockedModelRedirects - HEAD에서 Terra를 다른 모델로 돌리는 옵트인. 기본값은 비어 있다. 2.35.0에는 없을 수 있다
    경로 이슈 #2901 - 압축 공급자를 못 고른다. 이 이슈의 Terra 소모와 같은 층이다. 로그 필터와는 별개다

    메인테이너의 판단이 필요한 지점

    • 본 작업 Terra를 버그로 볼지, Codex 앱이 맨이름을 보내는 한 기대로 볼지
    • 압축을 커스텀으로 보낼지(No way to set compaction provider. #2901), blockedModelRedirects로 Terra만 막을지
    • 로그에 모델/공급자 필터를 이 이슈에 묶을지, 기능 요청으로 분리할지
    • 작성자에게 2.38.0 업그레이드와 가로채기 토글을 끈 전체 로그를 먼저 받을지

    너의 추천
    닫지 마세요. 월 잔량이 줄어드는 것 자체는 ChatGPT 네이티브 호출이 있다는 뜻이고, HEAD에서 그 길은 Terra 본 작업/압축이다. 가로채기 토글은 Luna 도우미만 보여 주니 Terra가 안 보이는 것은 그 필터의 계약이다. 작성자에게 가로채기를 끈 로그에서 코딩 턴 한 줄(model / resolvedModel / routeDecision)을 달라고 하세요. 본 작업이 이미 커스텀이면 남는 것은 압축(#2901)과 blockedModelRedirects다. 2.38.0으로 올린 뒤 Terra → 쓰는 커스텀 모델로 리디렉트하는 것이 지금 당장 쓸 수 있는 우회다. 로그 모델 필터는 별도 기능으로 받아도 된다. types/config 분할 무효화 해당 없음. 프리뷰 배포는 계획에 없습니다.

    이 댓글은 grok-bot이 작성했습니다

  4. lidge-jun commented on Sep 1, 2026

    @lidge-jun
    Owner

    Landed on dev via #3115 at 0db8066. The dashboard filter now matches requested/resolved/provider fields and every valid failover attempt target, while malformed attempt payloads are ignored safely. Exact-head CI: 0 failing, 0 pending. Closing as fixed.

  5. github-actions commented on Sep 1, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  6. Tao-Yida commented on Sep 1, 2026

    @Tao-Yida
    Author

    Based on #2901 , is gpt-5.6-terra used for compaction that lead to the decrease of my monthly window? If so, I have toggled off terra in my opencodex dashboard. Since there is no configuration for compaction model, will there be an enhanced feature that enables users to select custom models for compaction in the future?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingproxyHTTP proxy, routing, reverse-proxy / management auth

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions