OpenAIAuth
Fetch access tokens for chat.openai.com
Python version
from OpenAIAuth import Auth0
auth = Auth0(email="example@example.com", password="example_password")
access_token = auth.get_access_token()
Go version
package main
import (
"fmt"
"os"
"github.com/acheong08/OpenAIAuth/auth"
)
func main() {
auth := auth.NewAuthenticator(os.Getenv("OPENAI_EMAIL"), os.Getenv("OPENAI_PASSWORD"), os.Getenv("PROXY"))
err := auth.Begin()
if err.Error != nil {
println("Error: " + err.Details)
println("Location: " + err.Location)
println("Status code: " + fmt.Sprint(err.StatusCode))
println("Embedded error: " + err.Error.Error())
return
}
token, err := auth.GetAccessToken()
if err.Error != nil {
println("Error: " + err.Details)
println("Location: " + err.Location)
println("Status code: " + fmt.Sprint(err.StatusCode))
println("Embedded error: " + err.Error.Error())
return
}
fmt.Println(token)
}
Credits
- @linweiyuan
- @rawandahmad698
- @pengzhile
Release files for OpenAIAuth 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| OpenAIAuth-3.0.0.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| OpenAIAuth-3.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.1 kB
Release files / OpenAIAuth-3.0.0.tar.gz
| Download URL | OpenAIAuth-3.0.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f52ae9b6285e88ce6cf5823a1edebc6a10c630500359f050800594058dc4109f
|
|
BLAKE2b-256 checksum How to use checksums |
1ba001c339fe5132c3a4d54b0553b0100b6e84c342ae0e1e24b9175ba56a9f68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / OpenAIAuth-3.0.0-py3-none-any.whl
| Download URL | OpenAIAuth-3.0.0-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a013dac29099f1000c457e953d8319d5d21186228864290786f2ed386c2500d6
|
|
BLAKE2b-256 checksum How to use checksums |
356c17f8843d76cfa238fbb0e685d68d3764a019400d5c966bb7e1ef0ab87b46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|