codex

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultCodexClientID   = "app_EMoamEEZ73f0CkXaXp7hrann"
	CodexTokenURL          = "https://auth.openai.com/oauth/token"
	CodexUserAgent         = "codex-cli/0.149.0 (Linux; x64)"
	CodexOriginator        = "codex_cli_rs"
	DefaultCodexBackendURL = "https://chatgpt.com/backend-api/codex/responses"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID           string
	Pool         string
	RefreshToken string
	AccessToken  string
	AccountID    string
	ExpiresAt    time.Time
	// contains filtered or unexported fields
}

func ReadCodexCLIAuth

func ReadCodexCLIAuth() (*Account, error)

ReadCodexCLIAuth parses ~/.codex/auth.json

func (*Account) GetValidAccessToken

func (a *Account) GetValidAccessToken(ctx context.Context, client *http.Client) (string, error)

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(id string, accounts []*Account) *Provider

func (*Provider) Accounts

func (p *Provider) Accounts() []*Account

func (*Provider) ChatCompletion

func (p *Provider) ChatCompletion(ctx context.Context, req *providers.ChatRequest) (io.ReadCloser, bool, int, error)

func (*Provider) Embeddings

func (*Provider) ID

func (p *Provider) ID() string

func (*Provider) IsHealthy

func (p *Provider) IsHealthy() bool

func (*Provider) Models

func (p *Provider) Models(ctx context.Context) ([]providers.ModelInfo, error)

func (*Provider) TestAccount

func (p *Provider) TestAccount(ctx context.Context, accountID string) error

func (*Provider) TestConnection

func (p *Provider) TestConnection(ctx context.Context) error

func (*Provider) Type

func (p *Provider) Type() string

Jump to

Keyboard shortcuts

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