codex

package
v2026.716.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	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"
	ClientVersion = "0.144.1"
	UserAgent     = "codex_cli_rs/" + ClientVersion + " (Ubuntu 22.04.0; x86_64) WindowsTerminal"
	CallbackAddr  = "127.0.0.1:1455"
	CallbackPath  = "/auth/callback"
)

Variables

View Source
var (
	ChatGPTSubAPIBase   = "https://chatgpt.com/backend-api/codex"
	ChatGPTResponsesURL = "https://chatgpt.com/backend-api/codex/responses"
)

Functions

func BuildAuthorizeURL

func BuildAuthorizeURL(pkce PKCE) string

func ChatGPTAccountIDFromJWT

func ChatGPTAccountIDFromJWT(token string) string

func ListModels added in v2026.716.0

func ListModels(ctx context.Context, bearer, accountID string) ([]string, error)

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