# lanqian528/chat2api

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/lanqian528-chat2api).**

3,368 stars · 665 forks · Python · mit

## Links

- GitHub: https://github.com/lanqian528/chat2api
- awesome-repositories: https://awesome-repositories.com/repository/lanqian528-chat2api.md

## Description

chat2api is a web-to-API bridge and proxy that converts web-based chat sessions into a standardized API format. This allows web accounts to be used programmatically within third-party client applications.

The system includes a multi-account rotator that distributes requests across a pool of authentication tokens using random or sequential polling to bypass rate limits. It also functions as a multimodal API proxy, translating base64 or URL-encoded images and files into formats compatible with web-based chat interfaces.

The project manages the full lifecycle of session tokens, featuring stateful authentication and a mechanism for automatic token refreshing on a schedule. It also provides web interface mirroring to allow direct interaction with the original chat website through a proxy layer.

## Tags

### Web Development

- [API Bridges](https://awesome-repositories.com/f/web-development/api-bridges.md) — Provides a bridge that converts web-based chat sessions into a standardized API format for third-party applications. ([source](https://cdn.jsdelivr.net/gh/lanqian528/chat2api@main/README.md))
- [Web-to-API Converters](https://awesome-repositories.com/f/web-development/third-party-api-integrations/chat-api-integrations/web-to-api-converters.md) — Converts web-based chat sessions into a standard API for use in third-party applications.
- [API Proxies](https://awesome-repositories.com/f/web-development/api-proxies.md) — Translates base64 or URL-encoded images into formats compatible with web-based chat interfaces.

### Artificial Intelligence & ML

- [Provider Account Rotation](https://awesome-repositories.com/f/artificial-intelligence-ml/provider-account-rotation.md) — Bypasses AI provider rate limits by distributing requests across multiple web accounts.
- [Multimodal Model Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/multimodal-model-integrations.md) — Integrates multimodal capabilities by sending images and files to LLMs for visual analysis.

### Data & Databases

- [Authentication State Stores](https://awesome-repositories.com/f/data-databases/in-memory-data-stores/authentication-state-stores.md) — Stores and retrieves session tokens in a database to enable account sharing across multiple clients.

### Networking & Communication

- [Account Rotation Strategies](https://awesome-repositories.com/f/networking-communication/account-rotation-strategies.md) — Rotates through a pool of tokens using random or sequential polling to avoid rate limits. ([source](https://cdn.jsdelivr.net/gh/lanqian528/chat2api@main/README.md))
- [API Key Load Balancers](https://awesome-repositories.com/f/networking-communication/load-balancing/api-key-load-balancers.md) — Distributes API requests across a pool of authentication tokens using rotation to bypass rate limits.
- [LLM Session Managers](https://awesome-repositories.com/f/networking-communication/network-reliability-diagnostics/connection-session-management/llm-session-managers.md) — Manages the upload and refresh of web authentication tokens to maintain persistent API access to chat models.
- [Reverse Proxy Interceptors](https://awesome-repositories.com/f/networking-communication/traffic-interception/reverse-proxy-interceptors.md) — Implements a reverse proxy to mirror the official chat interface for session capture and authentication.

### Security & Cryptography

- [API Wrappers](https://awesome-repositories.com/f/security-cryptography/identity-access-management/authentication-strategies/session-and-credential-handling/session-credential-management/browser-session-authentication/session-based-scrapers/api-wrappers.md) — Converts active browser sessions into a programmatic API by intercepting and mirroring official HTTP request patterns.
- [Session Token Refreshers](https://awesome-repositories.com/f/security-cryptography/session-token-refreshers.md) — Automatically invokes refresh endpoints at defined intervals to maintain persistent chat sessions.
- [Access Token Management](https://awesome-repositories.com/f/security-cryptography/access-token-management.md) — Provides tools for uploading, viewing, and clearing authentication tokens used for API requests. ([source](https://cdn.jsdelivr.net/gh/lanqian528/chat2api@main/README.md))

### DevOps & Infrastructure

- [File Uploaders](https://awesome-repositories.com/f/devops-infrastructure/file-uploaders.md) — Supports processing images and files via URL or base64 encoding for multimodal interactions. ([source](https://cdn.jsdelivr.net/gh/lanqian528/chat2api@main/README.md))

### User Interface & Experience

- [Web Interface Mirrors](https://awesome-repositories.com/f/user-interface-experience/web-interface-mirrors.md) — Renders a native mirror of the official chat website to allow direct interaction through a proxy layer. ([source](https://cdn.jsdelivr.net/gh/lanqian528/chat2api@main/README.md))
