Trae-Proxy

作者 arch3rPro已验证

An intelligent API proxy tool designed to intercept and redirect OpenAI API requests.一个智能的API代理工具,专门用于拦截和重定向OpenAI API请求到自定义后端服务。支持多后端配置、动态模型映射和流式响应处理。

192
Stars
38
Forks
Python
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/arch3rPro/Trae-Proxy

快速入门

使用 Trae-Proxy 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Trae Proxy

Trae Proxy

English | 简体中文

A high-performance, low-latency API proxy middleware designed for large language model applications, capable of seamlessly intercepting and redirecting OpenAI API requests to any custom backend service. Supports multi-backend load balancing, intelligent routing, dynamic model mapping, and streaming response handling, allowing you to break through official API limitations and freely choose and integrate various LLM services while maintaining complete compatibility with existing applications.

📢 Introduction

  1. Trae IDE currently supports custom model providers, but only those fixed in the list, and does not support custom base_url, making it impossible to use your own API service.
  2. There are many related issues on Github, but the official response is minimal, such as: Add custom model provider base_url capability, Custom AI API Endpoint
  3. Based on this situation, Trae-Proxy was developed to proxy OpenAI API requests to custom backends, while supporting custom model ID mapping and dynamic backend switching.
  4. We hope the official team will soon implement custom base_url capability, making Trae a truly customizable IDE.

📸 Screenshots

Custom-Model

Custom-Model
Support for custom OpenAI-compatible APIs

IDE-Builder

IDE-Chat
Integration with Qwen3-Coder-Plus model

✨ Key Features

  • Intelligent Proxy: Intercept OpenAI API requests and forward them to custom backends
  • Multi-Backend Support: Configure multiple API backends with dynamic switching
  • Model Mapping: Custom model ID mapping for seamless model replacement
  • Streaming Response: Support for both streaming and non-streaming response modes
  • SSL Certificates: Automatic generation and management of self-signed certificates
  • Docker Deployment: One-click containerized deployment for production environments

⚠️ Disclaimer

  1. Trae-Proxy is a tool for intercepting and redirecting OpenAI API requests to custom backend services, without modifying or reverse engineering official software.
  2. This tool is for learning and research purposes only. Users should comply with relevant laws, regulations, and service terms.
  3. Theoretically, not only TraeIDE but also other IDEs or clients that support OpenAI SDK or API can seamlessly integrate with this tool.

🚀 Quick Start

Trae-Proxy installation and usage consists of the following steps:

  1. Install, configure, and start the Trae-Proxy server
  2. Install self-signed certificates on the client and modify hosts mapping (to forward OpenAI domain to the proxy service)
  3. Add models in the IDE, select OpenAI as the provider, customize model ID, and enter API key

Using Docker Compose (Recommended)

# Clone the repository
git clone https://github.com/arch3rpro/trae-proxy.git
cd trae-proxy

# Start the service
docker-compose up -d

# View logs
docker-compose logs -f

Manual Deployment

# Install dependencies
pip install -r requirements.txt

# Generate certificates
python generate_certs.py

# Start the proxy server
python trae_proxy.py

Configuration File Structure

Trae-Proxy uses a YAML format configuration file config.yaml:

# Trae-Proxy configuration file
# Proxy domain configuration
domain: api.openai.com

# Backend API configuration list
apis:
  - name: "deepseek-r1"
    endpoint: "https://api.deepseek.com"
    custom_model_id: "deepseek-reasoner"
    target_model_id: "deepseek-reasoner"
    stream_mode: null
    active: true
  - name: "kimi-k2"
    endpoint: "https://api.moonshot.cn"
    custom_model_id: "kimi-k2-0711-preview"
    target_model_id: "kimi-k2-0711-preview"
    stream_mode: null
    active: true
  - name: "qwen3-coder-plus"
    endpoint: "https://dashscope.aliyuncs.com/compatible-mode"
    custom_model_id: "qwen3-coder-plus"
    target_model_id: "qwen3-coder-plus"
    stream_mode: null
    active: true
# Proxy server configuration
server:
  port: 443
  debug: true

🖥️ Client Configuration

1. Get Server Self-Signed Certificate

Copy the CA certificate from the server to your local machine:

# Copy CA certificate from server
scp user@your-server-ip:/path/to/trae-proxy/ca/api.openai.com.crt .

2. Install CA Certificate

Windows

  1. Double-click the api.openai.com.crt file
  2. Select "Install Certificate"
  3. Select "Local Machine"
  4. Select "Place all certificates in the following store" → "Browse" → "Trusted Root Certification Authorities"
  5. Complete the installation

macOS

  1. Double-click the api.openai.com.crt file, which will open "Keychain Access"
  2. Add the certificate to the "System" keychain
  3. Double-click the imported certificate, expand the "Trust" section
  4. Set "When using this certificate" to "Always Trust"
  5. Close the window and enter your administrator password to confirm

3. Modify Hosts File

Windows

  1. Edit C:\Windows\System32\drivers\etc\hosts as administrator
  2. Add the following line (replace with your server IP):
    your-server-ip api.openai.com
    

macOS

  1. Open Terminal
  2. Execute sudo vim /etc/hosts
  3. Add the following line (replace with your server IP):
    your-server-ip api.openai.com
    

4. Test Connection

curl https://api.openai.com/v1/models

If configured correctly, you should see the model list returned by the proxy server.

🔧 System Requirements

  • Server: Python 3.9+, OpenSSL, Docker
  • Client: Administrator privileges (for modifying hosts file and installing certificates)

📁 Project Structure

trae-proxy/
├── trae_proxy.py          # Main proxy server
├── trae_proxy_cli.py      # Command-line management tool
├── generate_certs.py      # Certificate generation tool
├── config.yaml            # Configuration file
├── docker-compose.yml     # Docker deployment configuration
├── requirements.txt       # Python dependencies
└── ca/                    # Certificates and keys directory

🔍 How It Works

 +------------------+    +--------------+    +------------------+
 |                  |    |              |    |                  |
 |                  |    |              |    |                  |
 |  DeepSeek API    +--->+              +--->+  Trae IDE        |
 |                  |    |              |    |                  |
 |  Moonshot API    +--->+              +--->+  VSCode          |
 |                  |    |              |    |                  |
 |  Aliyun API      +--->+  Trae-Proxy  +--->+  JetBrains       |
 |                  |    |              |    |                  |
 |  Self-hosted LLM +--->+              +--->+  OpenAI Clients  |
 |                  |    |              |    |                  |
 |  Other API Svcs  +--->+              |    |                  |
 |                  |    |              |    |                  |
 |                  |    |              |    |                  |
 +------------------+    +--------------+    +------------------+
   Backend Services       Proxy Server        Client Apps

💡 Use Cases

  • API Proxy: Forward OpenAI API requests to privately deployed model services
  • Model Replacement: Replace official OpenAI models with custom models
  • Load Balancing: Distribute requests among multiple backend services
  • Development Testing: API simulation and testing in local development environments

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

常见问题

What is Trae-Proxy?

Trae-Proxy is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by arch3rPro. An intelligent API proxy tool designed to intercept and redirect OpenAI API requests.一个智能的API代理工具,专门用于拦截和重定向OpenAI API请求到自定义后端服务。支持多后端配置、动态模型映射和流式响应处理。. It has 192 GitHub stars.

Is Trae-Proxy safe to use?

Yes. Trae-Proxy passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install Trae-Proxy?

Clone the repository with "git clone https://github.com/arch3rPro/Trae-Proxy" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is Trae-Proxy written in?

Trae-Proxy is primarily written in Python. It is open-source under arch3rPro on GitHub, so you can review or fork the full source.

Are there alternatives to Trae-Proxy?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh Trae-Proxy against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情