Skip to main content

This is an unofficial implementation of the grok as api(reverse).

Project description

revGrok: Unofficial Grok API Wrapper

revGrok is an unofficial implementation that allows you to interact with Grok’s API in reverse.

Installation

To use this library, follow these simple steps:

  1. Install the package:

    pip install -U revgrok
    
  2. Obtain your authentication cookie:

    • Log in to the Grok web app and start any conversation.
    • Record the cookie value from your browser. Cookie
  3. Use the library: A simple example script, chat_example.py, demonstrates how to interact with Grok.

Example Usage

import asyncio
from src.revgrok import GrokClient

async def main():
    cookie = "Your cookie here"  # Replace with your actual cookie
    model = "grok-3"  # Choose your model (e.g., grok-3)
    prompt = "9.8 and 9.11, which is bigger?"  # Define your prompt

    client = GrokClient(cookie=cookie)
    async for response in client.chat(prompt=prompt, model=model, reasoning=False):
        print(response, end="")

if __name__ == "__main__":
    asyncio.run(main())
  • Set reasoning=True if you want to enable reasoning or leave it as False to disable it.
  • For free accounts, your usage may soon be limited. Consider upgrading to a paid plan to avoid interruptions.

Contribution

If you'd like to contribute to this project, feel free to fork the repository and submit a pull request!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

revgrok-0.1.5.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

revgrok-0.1.5-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file revgrok-0.1.5.tar.gz.

File metadata

  • Download URL: revgrok-0.1.5.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for revgrok-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a657d875a42fa10056e5d2aa95a84c94ba241cb6340383770364100da812a351
MD5 f8e6fc12f225487200543906d8030d34
BLAKE2b-256 8c1f52f46fa27dd060ce51bd7486b4cb6fc034d561844cd97edb99e92af277ff

See more details on using hashes here.

File details

Details for the file revgrok-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: revgrok-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for revgrok-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 885f41e5931599fc8bef07a8b58a4ec8eca68fd535b11b4ebf59abd40cef53b4
MD5 20d171cda68edca2723443dfdf840506
BLAKE2b-256 b6932ca4129f65a5caf89d13527ac6a67127b42eb866e0c297e3cbc71dfd6b15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page