Status: [LIVE] Endpoints found: https://chat.humain.ai/ Source: https://github.com/Bot4Zaki/Humain_WebAI_to_API # Humain WebAI to API Proxy This is a local Python proxy server that wraps the [Humain AI (ALLaM)](https://chat.humain.ai/) web chat interface and exposes it as a standard OpenAI-compatible Streaming API. It is designed to seamlessly integrate Humain's ALLaM model into Agentic IDEs like **OpenClaw**, allowing you to use ALLaM as a coding assistant with full memory retention, dynamic web search, and perfect timeout management. ## Features - **100% OpenAI API Compatible**: Exposes `/v1/chat/completions`. - **True Memory**: Re-uses native Humain `conversation_id`s, ensuring flawless memory retention across multi-turn chats. - **Smart Web Search**: Detects phrases like `"search the web"`, `"google"`, or `"latest news"` in your prompt and automatically triggers Humain's web search tool. It streams back `*(Searching the web for: ...)*` to your UI so you're never waiting blindly. - **Agent-Ready Timings**: Instantly yields an initialization chunk back to the IDE to defeat the strict 10-second streaming timeouts commonly found in Agentic AI clients. - **Auto Token Refresh**: Runs a persistent, headless Playwright browser instance in the background to automatically refresh the short-lived API tokens every 30 minutes. ## Requirements - Python 3.9+ - Chrome/Chromium installed (for Playwright) ## Installation 1. Clone this repository. 2. Create a virtual environment and install dependencies: ```bash python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt playwright install chromium ``` ## First-Time Setup (Login) You need to authorize the proxy to use your Humain account. Because the proxy uses a persistent Playwright browser profile, you only need to do this once (or whenever your underlying Humain session cookie expires, usually every few weeks). Run the login script: ```bash python login.py ``` This will open a visible Chrome window. Log in to `chat.humain.ai`. Once you are fully logged in and can see the chat interface, **close the browser w