Skip to main content

UnlimitedChatGPTWebAPI

Resolve Cloudflare Challenge To use ChatGPT Web API

Installation

pip3 install UnlimitedChatGPTWebAPI

then you should run playwright install chromium

For windows, maybe you should use it -> playwright install-deps chromium

Configuration

  1. Make sure your network or agent can access https://chat.openai.com
  2. Please make sure that the VPS RAM is not too small.

Usage

Basic example

import asyncio

from UnlimitedChatGPTWebAPI import ChatSession


async def main():
    async with ChatSession(proxies="socks5://localhost:7890") as session:
        # or use this if you want to use the same session for multiple requests
        # example:
        # session = ChatSession(proxies="socks5://localhost:7890")
        # await session.init_page()
        async with session.fetch(
            method="GET",
            url="/backend-api/models",
            headers={"Authorization": "Bearer xxx"}
        ) as resp:
            print(await resp.json())

if __name__ == "__main__":
    asyncio.run(main())

Streaming example

import asyncio

from UnlimitedChatGPTWebAPI import ChatSession


async def main():
    async with ChatSession(proxies="socks5://localhost:7890") as session:
        # or use this if you want to use the same session for multiple requests
        # example:
        # session = ChatSession(proxies="socks5://localhost:7890")
        # await session.init_page()
        async with session.fetch(
            method="GET",
            url="/backend-api/models",
            headers={"Authorization": "Bearer xxx"}
        ) as resp:
            data = b""
            async for chunk in resp.iter_chunked():
                data += chunk
            print(data.decode())

if __name__ == "__main__":
    asyncio.run(main())

Release files for UnlimitedChatGPTWebAPI 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for UnlimitedChatGPTWebAPI 0.1.2
File Size Uploaded
UnlimitedChatGPTWebAPI-0.1.2.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for UnlimitedChatGPTWebAPI 0.1.2
File Interpreter ABI Platform
UnlimitedChatGPTWebAPI-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 kB

Release files / UnlimitedChatGPTWebAPI-0.1.2.tar.gz

Download URL UnlimitedChatGPTWebAPI-0.1.2.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d0b54f7790d84cb09b1afdae8e9b4008549fd47f7ffb33ce1fc806867a4aee88
BLAKE2b-256 checksum
How to use checksums
ab42540e171fc5360828a3d20d641cd12d9f2e5ba356bdef34ba7c95abf6a755
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / UnlimitedChatGPTWebAPI-0.1.2-py3-none-any.whl

Download URL UnlimitedChatGPTWebAPI-0.1.2-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69ba74830e17d95086c87e179ac30f5022af1feada5d2389c2b3d05ee525b1e6
BLAKE2b-256 checksum
How to use checksums
043337459433878b6c96b6ec24eed77bc2f0ae9d99ebcbf8e658b5328d2d4af7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page