⚠️ Important Notice: Use at Your Own RiskThis script is provided for educational purposes only. Automating requests to a website's API may violate the Terms of Service of Sora/OpenAI. Using this script could potentially result in your account being suspended or banned. You are solely responsible for how you use this tool. The author of this script assumes no liability. Proceed with caution.
For the best results, it is highly recommended to use the Mozilla Firefox browser and connect to a VPN server located in the USA. This helps to match the request headers that are most commonly accepted by the API.
- Generates Codes: The script creates random 6-character invite codes in the format
0A1B2C. - Submits Codes: It uses multiple threads to submit these codes to the Sora API as fast as possible.
- Handles Responses:
- If a code is successful (200 OK), it's saved to
success.txt. - If a code is invalid (403 Forbidden), it's saved to
invalid_codes.txtand never tried again. - If the script is rate-limited (429 Too Many Requests), it waits and retries.
- If your authentication fails (401 Unauthorized), the script will stop and tell you to update your token.
- If a code is successful (200 OK), it's saved to
- Smart Blacklist & Cache: The script is intelligent. It uses
used_codes.txtandinvalid_codes.txtas a "blacklist cache". Every time it starts, it loads these files to ensure it never tries the same code twice, whether it was successful, invalid, or simply attempted before. This makes the script highly efficient, especially when you stop and restart it.
💡 Head Start Included! This package includes
invalid_codes.txtpre-populated with 10,000 known invalid codes to save you time and reduce unnecessary API requests. The script will automatically skip these codes when generating new ones.
Follow these steps carefully to get the script running.
- Make sure you have Python installed.
- Double-click the
install.batfile. It will automatically create a virtual environment and install the necessary library.
This is the most important step. The script needs your personal authentication token to work.
- Open Mozilla Firefox and log in to
https://sora.chatgpt.com. - Press the
F12key to open the Developer Tools. - Go to the Network tab.
- If the list is empty, refresh the page or navigate to
https://sora.chatgpt.com/explore. - In the filter box (🔍), type
sorato show only requests to the Sora server. - Click on any request in the list.
- On the right, find the Headers section and scroll down to Request Headers.
- Look for the
authorizationheader. It will look like this:authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9... - Copy the long string of characters after the word
Bearer. - Paste the token you copied into
auth.txt. Do not includeBearer. Save the file.
You can fine-tune the script's performance by editing the params.txt file.
max_workers: The number of threads used to submit codes. More threads can be faster but may increase the chance of being rate-limited.delay: The pause (in seconds) between processing codes. A higher delay is safer.max_retries: How many times the script will try to resubmit a code if it gets a rate-limit error.retry_delay: The base time (in seconds) the script waits before retrying.
If you are unsure, the default values in params.txt are a good starting point.
The script needs to look like it's coming from your specific browser.
- In the same Network tab where you found your token, look for the
OAI-Device-IdandUser-Agentheaders, usually below the auth token. - Copy the values for both.
- Open the
config.txtfile that came with the script. - Replace the placeholder values with your own
OAI-Device-IdandUser-Agent. Save the file.
Once you have completed the steps above, you are ready to run the script.
On Windows:
- Double-click the
run.batfile.
The script will start running and show you its progress. Press Ctrl+C to stop it at any time.
sora.py: The main Python script.auth.txt: (You edit this) Your secret authentication token.config.txt: (You edit this) Your browser's Device ID and User Agent.params.txt: (You edit this) Script parameters like thread count and delays.install.bat: (Run this first) Sets up the Python virtual environment.run.bat: (Run this to start) Activates the environment and starts the script.success.txt: Automatically created. Contains all successfully submitted codes.invalid_codes.txt: Pre-loaded with 10,000 invalid codes! A "blacklist" of codes that are known to be invalid. The script automatically skips these when generating new codes.
