Skip to content

linkedlist771/revGrok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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!

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages