How to Use a Proxy on Janitor AI: The Definitive Technical Guide
Janitor AI has emerged as a powerful platform for AI roleplay, leveraging Large Language Models (LLMs) like GPT-4 and Claude. However, due to API costs, regional restrictions, or platform-specific security filters, users often encounter connection errors. This is where proxies and reverse proxies become essential tools.
In 2025, using a proxy with Janitor AI is the standard solution for bypassing Cloudflare "Failed to fetch" errors and accessing uncensored models. This guide will walk you through the technical architecture, setup procedures, and Python-based automation for using proxies effectively.
---
Understanding Proxies in the Context of Janitor AI
Before configuring the settings, it is vital to understand what a proxy does in this ecosystem. A proxy acts as an intermediary between your client (the browser or app connecting to Janitor AI) and the LLM API endpoint.
1. The Need for Proxies
Janitor AI does not host the models itself; it connects to external APIs (like OpenAI).
- Cloudflare Protection: OpenAI and other providers use aggressive bot mitigation. Direct requests from residential IPs are often blocked.
- Reverse Proxies (The "Janitor" Standard): Unlike a standard forward proxy, the Janitor AI community primarily utilizes reverse proxies. These are servers that sit in front of the LLM API, masking the true endpoint and allowing users to input their own API keys to access models (often including "uncensored" variants of Claude or GPT) that might otherwise be restricted on the main Janitor interface.
- HTTP/HTTPS Proxies: Standard for web scraping and API requests. They handle HTTP traffic but may not handle the specific WebSocket upgrades used by some chat interfaces.
- SOCKS5 Proxies: More robust, handling traffic at a lower level. Preferred if you are routing the entire browser traffic through a tool like Selenium or Puppeteer.
- Reverse Proxy URLs: Specifically required by Janitor AI's "Kobold" or "OpenAI" settings. These usually look like
https://[domain]/v1. - *Self-Hosted:* Many developers deploy a "Pandora" or "OpenAI-Reverse-Proxy" on Replit, Hugging Face, or a VPS.
- *Public Endpoints:* These are often shared in Discord communities associated with Janitor AI.
- Proxy URL: Enter the reverse proxy address.
- API Key: Paste the API key corresponding to the service the proxy is forwarding to. Security Warning: Never use your main paid OpenAI key on a public, untrusted reverse proxy. If you must use a paid key, run the proxy yourself.
- Toggle Proxy: Ensure the "Enable Proxy" or "Use Reverse Proxy" toggle is active.
2. Proxy Types
---
Method 1: Configuring Reverse Proxies via the Janitor UI
This is the most common method for users accessing the web interface.
Step 1: Locate the API Menu
1. Log in to your Janitor AI account. 2. Navigate to the API Settings (often found under the user profile icon or the "FAQ" menu, depending on the current UI update). Look specifically for the option to switch from "JanitorAI Models" to external APIs like OpenAI or Kobold.
Step 2: Obtain a Proxy URL
You need a working endpoint. In 2025, many users rely on public repositories or self-hosted solutions.
Step 3: Input the Configuration
In the API settings:
* *Example:* https://my-proxy.hf.space/v1
---
Method 2: Browser Automation with Python (Selenium)
For advanced users looking to automate scraping or interaction with Janitor AI, using a proxy programmatically is required.
Prerequisites
You will need selenium and webdriver-manager.
pip install selenium webdriver-manager
Python Code: Routing Janitor AI through a Proxy
This script configures a Chrome browser to route traffic through a proxy before accessing Janitor AI. This is useful if your IP is temporarily banned by Cloudflare.
from selenium import webdriver
from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time
Configuration
PROXY_HOST = "192.168.1.10" # Replace with your proxy IP PROXY_PORT = "8080" # Replace with your proxy port USERNAME = "user" # Proxy Username (if auth needed) PASSWORD = "pass" # Proxy Password TARGET_URL = "https://janitorai.com"
def setup_proxy_chrome(): # Configure Chrome Options options = webdriver.ChromeOptions()
# Set the proxy address options.add_argument(f'--proxy-server=http://{PROXY_HOST}:{PROXY_PORT}')
# Add arguments to bypass detection options.add_argument("--disable-blink-features=AutomationControlled") options.add_experimental_option("excludeSwitches", ["enable-automation"]) options.add_experimental_option('useAutomationExtension', False)
# Initialize Driver service = Service(ChromeDriverManager().install()) driver = webdriver.Chrome(service=service, options=options)
# Handle Proxy Authentication (Basic Auth extension method is most reliable for Chrome) # Note: You may need to download a 'proxy auth' extension or use a proxy that whitelists IPs
return driver
if __name__ == "__main__": try: driver = setup_proxy_chrome() print("Navigating to Janitor AI...") driver.get(TARGET_URL)
# Wait for manual login or Cloudflare clearance print("Waiting for page load...") WebDriverWait(driver, 30).until( EC.presence_of_element_located((By.TAG_NAME, "body")) )
print("Connected successfully via proxy.") time.sleep(10) # Keep alive
except Exception as e: print(f"Error: {e}") finally: driver.quit()
Methodology
1. Avoiding Detection: Janitor AI and its underlying APIs (OpenAI/Cloudflare) use TLS fingerprinting. The script disables AutomationControlled flags to look more like a human user. 2. Residential Proxies: For the code above to work reliably with strict APIs, you should use Residential Proxies rather than datacenter proxies. Datacenter IPs are frequently blacklisted by OpenAI.
---
Troubleshooting Common Proxy Errors (2025 Edition)
Error 1: "Failed to Fetch"
https://. Check if the proxy provider has a status page.Error 2: "401 Unauthorized"
Error 3: Cloudflare Loop (Error 520/522)
---
Technical Comparison: Direct vs. Proxy Connection
| Feature | Direct Connection (Native) | Reverse Proxy Connection | | :--- | :--- | :--- | | Speed | High (Direct link to OpenAI) | Medium (Adds an extra hop) | | Reliability | Low (Prone to IP bans) | High (Masks client IP) | | Model Access | Standard GPT-3.5/4 | Can enable "Jailbroken" or Claude 2 | | Setup Difficulty | Easy (Paste Key) | Moderate (Need Endpoint URL) | | Privacy | High (Direct to OpenAI) | Low (Proxy sees traffic) |
Conclusion
Using a proxy with Janitor AI is a technical necessity for users facing restrictions or seeking access to specific models. While the UI method (configuring the Reverse Proxy URL) is sufficient for most casual users, developers leveraging Python and Selenium can achieve greater flexibility by routing entire browser sessions through residential or rotating proxy servers.
Security Note: Always exercise caution when entering API keys into third-party reverse proxies. For maximum security in 2025, the best practice is deploying your own private reverse proxy on a VPS.