Skip to content

[Feature]: Add TRAE International (trae.ai) provider via official authentication #201

Closed as not planned

Description

@czwaxm

Problem to solve

OpenCodex currently has no built-in provider for TRAE International (trae.ai).

Users who already have a TRAE International account/subscription cannot select TRAE-hosted models from Codex CLI or the Codex App through OpenCodex. The available community workarounds generally expose an OpenAI-compatible proxy by extracting IDE credentials, capturing private headers, or calling undocumented endpoints. Those approaches are fragile and create avoidable account and credential risks.

This request is specifically for the international service at trae.ai, not TRAE CN (trae.cn) or the enterprise PAT flow.

Proposed solution

Add a built-in provider such as trae or trae-international that uses a supported TRAE authentication/transport boundary.

Preferred integration path:

  1. Reuse the official TRAE CLI login/session, with TRAE itself owning the browser OAuth flow and token refresh.
  2. If available in the international CLI distribution, communicate through its ACP server (the community ACP client acpx currently registers TRAE as traecli acp serve).
  3. Expose the provider through the existing OpenCodex CLI and dashboard:
    • add/login/logout/status
    • model discovery or a maintained model catalog
    • provider/model selection in Codex
  4. Translate between Codex Responses API behavior and the upstream transport, including:
    • streaming text
    • multi-turn sessions
    • tool calls and tool results
    • cancellation and timeout propagation
    • upstream errors and usage data when available
  5. Support the same platforms as OpenCodex where the official TRAE CLI is available.

If TRAE International does not currently expose a supported API or ACP contract, an initial outcome could be documented provider scaffolding or a capability check that explains what upstream support is missing, rather than relying on private IDE endpoints.

Security/non-goals

The integration should not:

  • decrypt or copy tokens from TRAE IDE storage
  • require browser scripts to extract credentials
  • require packet capture, device fingerprint spoofing, or hard-coded IDE headers
  • silently fall back to trae.cn or enterprise-only endpoints
  • persist refresh tokens outside the official TRAE authentication owner unless explicitly required and securely handled

Alternatives considered

  • Configure a third-party TRAE-to-OpenAI proxy as a custom OpenAI-compatible provider. This can work mechanically, but existing projects generally depend on credential extraction or undocumented private endpoints.
  • Add a TRAE adapter locally to OpenCodex. This duplicates provider/auth/session work and leaves other users without a maintained solution.
  • Use an OpenCode-specific TRAE plugin. OpenCode is a different client and cannot be used directly as OpenCodex's HTTP upstream.

Additional context

I would be happy to help test the integration on Windows with a TRAE International account.

Activity

  1. Wibias commented on Jul 21, 2026

    @Wibias
    Contributor

    Investigation: TRAE International provider feasibility

    I dug into both TRAE CLI projects and the ACP protocol to assess what's actually available for a trae.ai integration. Here's what I found.

    Two different "TRAE CLI" projects exist

    1. bytedance/trae-agent (open-source Python CLI, entrypoint trae-cli)

    This is a general-purpose LLM agent that talks to OpenAI, Anthropic, Google, OpenRouter, etc. via API keys in trae_config.yaml or env vars. It has no TRAE account login and no OAuth flow. There's an open feature request (bytedance/trae-agent#381, filed March 2026) asking for exactly that. Still unresolved.

    2. traecli (the TRAE IDE CLI, installed via irm https://trae.cn/trae-cli/install.ps1 | iex)

    This is the one acpx registers as trae -> traecli acp serve. It supports ACP, but:

    • All CLI/ACP documentation lives under docs.trae.cn, the CN service
    • The install script points to trae.cn, not trae.ai
    • The only OAuth flow documented is for MCP server authentication (browser-based), not for ACP session auth
    • ACP itself standardizes authMethods + authenticate + logout at the protocol level, but token refresh is not specified. It's left to the agent implementation

    The core problem for this issue

    This issue asks for TRAE International (trae.ai), not TRAE CN (trae.cn). But:

    • The international site at trae.ai/download offers the IDE but there is no CLI install path for the international service
    • The traecli binary and its ACP server are documented exclusively under the CN domain
    • There's no evidence that traecli acp serve works with a trae.ai account rather than a trae.cn account
    • The ACP auth contract doesn't define token refresh, so even if we could talk to it, we'd be reverse-engineering the session lifecycle

    What would unblock a real integration

    One of these needs to happen upstream:

    1. TRAE International ships a CLI distribution with a documented OAuth/refresh contract (similar to how Grok CLI exposes a local SQLite token store, or how Claude Code has a documented OAuth flow)
    2. bytedance/trae-agent#381 gets resolved and the open-source CLI gains TRAE OAuth for the international service
    3. TRAE International publishes an OpenAI-compatible API endpoint with standard bearer-token auth

    Current stance

    We're not building on trae.cn endpoints, IDE credential extraction, or undocumented headers. The security non-goals in this issue are correct and we respect them.

    If any of the above upstream conditions change, this becomes a straightforward addition following the existing provider pattern (registry entry + OAuth flow + adapter). Until then, this issue stays open as a tracking item for upstream readiness.

    Happy to revisit if anyone finds a supported international CLI path or if the upstream situation changes.

  2. lidge-jun commented on Jul 22, 2026

    @lidge-jun
    Owner

    Update on scoping: adding TRAE International needs an officially supported authentication and transport contract (how tokens are issued/refreshed, and which inference endpoint shape is exposed). Right now there is no documented official API surface we can build against without relying on reverse-engineered internals, which we avoid for providers that can break silently. Keeping this open as a provider request; if you can point to official API docs or a sanctioned developer program, that unblocks the work.

  3. added
    roadmap
    enhancement
    on Jul 22, 2026
  4. added
    account-pool
    catalog
    tools
    provider
    on Aug 1, 2026
  5. lidge-jun commented on Aug 2, 2026

    @lidge-jun
    Owner

    Triage status (verified 2026-08-02): TRAE International exists, but the official enterprise page still lists the CLI as "coming soon" and we could not find a sanctioned international inference/authentication API. Please link the official API documentation if one exists now; without a sanctioned API surface this request stays parked.

  6. github-actions commented on Aug 2, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: unknown.

  7. Wibias commented on Aug 8, 2026

    @Wibias
    Contributor

    Status: blocked on a supported upstream transport.

    Implementation should not use extracted IDE credentials, private headers, packet capture, or undocumented IDE endpoints.

    Unblock criteria:

    • an officially supported TRAE API, ACP server, CLI integration contract, or equivalent documented transport is available; and
    • its authentication/session ownership model is clear enough for OpenCodex to integrate without copying private credentials.

    Until then this is a provider-readiness tracker, not implementation-ready work.

  8. lidge-jun commented on Aug 19, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 34 / 80

    현재 dev에는 TRAE International(trae.ai) 내장 프로바이더가 없습니다. trae 문자열은 src에서 검색되지 않습니다. 사용자는 Codex에서 TRAE 호스트 모델을 고를 수 없고, 커뮤니티 우회는 IDE 자격 증명 추출, 사설 헤더, 미문서 엔드포인트에 의존합니다. 이슈가 그 경로를 명시적으로 거부한 것은 저장소 위생과 맞습니다.

    이슈가 원하는 것은 공식 인증/수송입니다. TRAE CLI 로그인/세션을 재사용하고, 가능하면 ACP(traecli acp serve)로 말하며, 기존 CLI/대시보드의 로그인·상태·모델 선택에 올리는 것입니다. 대상은 trae.ai이지 trae.cn이나 엔터프라이즈 PAT가 아닙니다. 공식 API/ACP가 없으면 스캐폴딩과 능력 검사가 초기 결과여야 합니다.

    네이티브 신뢰성이 점수를 낮춥니다. IDE 저장소 복호화, 브라우저 스크립트, 패킷 캡처, 지문 위조, 하드코딩 IDE 헤더는 침묵 장애와 계정 위험을 만듭니다. Wibias 조사는 오픈소스 trae-agent와 국제 서비스가 다르고, 기업 페이지는 CLI를 coming soon으로 둔다고 했습니다. 허가된 국제 추론 API가 없으면 구현을 시작하면 안 됩니다.

    Windows/서비스에서 비공식 엔드포인트는 더 잘 깨집니다. 서드파티 TRAE-to-OpenAI 프록시를 커스텀 프로바이더로 쓰는 것은 사용자가 할 수 있어도, 내장 프로바이더로 올리면 OpenCodex가 그 깨짐을 떠안습니다.

    해결방안은 공식 API/ACP/CLI 계약과 세션 소유권이 문서화되기 전에는 이 이슈를 주차하는 것입니다. 그 계약이 오면 기존 OAuth 프로바이더 패턴으로 로그인·카탈로그·와이어 번역을 추가합니다. 패치는 추측하지 않으며, 현재 트리에 TRAE 통합은 없습니다.

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

  9. lidge-jun commented on Aug 19, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 34 / 80 · 종결

    trae.ai 계정을 공식 로그인으로 붙이는 프로바이더 요청임. 지금 커뮤니티는 IDE 토큰/헤더 훔쳐서 OpenAI 호환 프록시 돌리는 식이라 깨지기 쉽고 계정 위험함. CN(trae.cn)이랑 엔터프라이즈 PAT는 이 이슈 범위 아님.

    방향은 이해함. 다만 지금은 안 함. 공식 CLI 세션/ACP를 타더라도 인증·리프레시·카탈로그·툴을 새로 깔아야 해서 프로바이더 추가 비용이 큼. 머지 플랜/코어 쪽 먼저임. 비공식 크레덴셜 스크레이프는 이쪽에서 안 받음.

    나중에 공식 인증 경계가 분명한 PR이면 봄. 그전까지 이 이슈는 열어 두지 않음.

    해결방안: 지금은 패치 없음. 후속이면 TRAE가 소유한 로그인/세션만 재사용하고, 헤더 캡처·undocumented 엔드포인트는 거절.

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

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

    account-poolcatalogenhancementproviderroadmaptools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions