web2api  by caiwuu

AI web services to OpenAI-compatible APIs

Created 3 weeks ago

New!

398 stars

Top 72.5% on SourcePulse

GitHubView on GitHub
Project Summary

Web2API bridges web-based AI services (e.g., Claude Web) into OpenAI/Anthropic compatible APIs. It targets developers seeking to integrate these services into existing applications using familiar SDKs without modifying client code or managing complex browser automation. The primary benefit is seamless integration and reduced development overhead.

How It Works

This service acts as a proxy, wrapping web AI interfaces into standard API endpoints. It leverages a real browser environment (Chromium) to manage dynamic web interactions like session state, anti-bot measures, and conversation history, which are difficult to replicate via direct network calls. This approach ensures robust compatibility and session reuse.

Quick Start & Requirements

  • Primary Install: Docker is recommended. Clone the repo, download config.container.yaml to docker-data/config.yaml, modify it, and run: docker run -d --name web2api --restart unless-stopped --shm-size=1g -p 9000:9000 -v "$(pwd)/docker-data:/data" ghcr.io/caiwuu/web2api:latest.
  • API Endpoint: http://127.0.0.1:9000
  • Config Page: http://127.0.0.1:9000/config
  • Source Install: Requires Python 3.12+, uv, fingerprint-chromium, a proxy, and a Claude sessionKey. Installation involves git clone, uv sync, and running main.py, potentially with xvfb on Linux. Configuration is done via config.yaml and the web UI.
  • Prerequisites: Python 3.12+, uv, fingerprint-chromium, proxy service, Claude sessionKey. External resources for proxies and accounts are mentioned, e.g., Cliproxy and aizhp.site. IP purity can be checked via https://ping0.cc/ip/.
  • Documentation: Further details available in docs/config.md, docs/faq.md, docs/architecture.md.

Highlighted Details

  • Supports image inputs (OpenAI image_url, Anthropic image formats).
  • Handles both streaming and non-streaming API responses.
  • Implements tool call functionality (ReAct).
  • Offers dual protocol support for OpenAI and Anthropic API standards.
  • Features a visual configuration interface for proxies, accounts, fingerprints, and timezones.

Maintenance & Community

The provided README does not detail specific contributors, community channels (like Discord/Slack), or a public roadmap.

Licensing & Compatibility

The repository's license is not specified in the README. This lack of clarity prevents an immediate assessment of commercial use compatibility or potential copyleft restrictions.

Limitations & Caveats

The core limitation is the reliance on a real browser environment, necessary for handling complex web interactions. Session IDs are appended to responses using zero-width characters, requiring careful handling if chat history is manually managed. Sensitive credentials (session keys, proxy details) must be secured, and account distribution across IPs is recommended to mitigate risk controls.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
21
Issues (30d)
3
Star History
400 stars in the last 26 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Magnus Müller Magnus Müller(Cofounder of Browser Use), and
4 more.

web-ui by browser-use

0.2%
16k
Web UI for AI browser agent
Created 1 year ago
Updated 7 months ago
Feedback? Help us improve.