codex

package
v2026.609.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChatGPTSubAPIBase   = "https://chatgpt.com/backend-api/codex"
	ChatGPTResponsesURL = "https://chatgpt.com/backend-api/codex/responses"
	AuthorizeURL        = "https://auth.openai.com/oauth/authorize"
	TokenURL            = "https://auth.openai.com/oauth/token"
	ClientID            = "app_EMoamEEZ73f0CkXaXp7hrann"
	RedirectURI         = "http://localhost:1455/auth/callback"
	Scopes              = "openid profile email offline_access api.connectors.read api.connectors.invoke"
	Originator          = "codex_cli_rs"
	UserAgent           = "codex_cli_rs/0.38.0 (Ubuntu 22.04.0; x86_64) WindowsTerminal"
	CallbackAddr        = "127.0.0.1:1455"
	CallbackPath        = "/auth/callback"
)

Variables

This section is empty.

Functions

func BuildAuthorizeURL

func BuildAuthorizeURL(pkce PKCE) string

func ChatGPTAccountIDFromJWT

func ChatGPTAccountIDFromJWT(token string) string

func SubModelCatalog

func SubModelCatalog() []string

func WithChatGPTSubMiddleware

func WithChatGPTSubMiddleware(accountID string) option.RequestOption

Types

type PKCE

type PKCE struct {
	Verifier  string
	Challenge string
	State     string
}

func NewPKCE

func NewPKCE() (PKCE, error)

type TokenSet

type TokenSet struct {
	AccessToken  string
	RefreshToken string
	AccountID    string
	ExpiresAt    time.Time
}

func Login

func Login(ctx context.Context, out io.Writer) (ts TokenSet, err error)

func Refresh

func Refresh(ctx context.Context, refreshToken string) (TokenSet, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL