modelauth

package
v1.0.0-rc.17 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 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 BaseURL = "https://chatgpt.com/backend-api/codex"
View Source
const ProviderType = "openai-codex"

Variables

View Source
var ErrLoginRequired = errors.New("ChatGPT login required; run contenox-runtime backend login <name>")

Functions

func CredentialGeneration

func CredentialGeneration(ctx context.Context, store runtimetypes.Store, id string) (string, error)

func DeleteCredentials

func DeleteCredentials(ctx context.Context, exec libdb.Exec, id string) error

Types

type DeviceCode

type DeviceCode struct {
	URL       string
	Code      string
	ExpiresAt time.Time
}

type Service

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

func New

func New(db libdb.DBManager) *Service

func (*Service) Headers

func (s *Service) Headers(ctx context.Context, id string) (http.Header, error)

func (*Service) Login

func (s *Service) Login(ctx context.Context, id string, show func(DeviceCode) error) error

func (*Service) Logout

func (s *Service) Logout(ctx context.Context, id string) error

func (*Service) Status

func (s *Service) Status(ctx context.Context, id string) (Status, error)

type Status

type Status struct {
	State      string    `json:"state"`
	ExpiresAt  time.Time `json:"expiresAt,omitempty"`
	Generation string    `json:"-"`
}

Jump to

Keyboard shortcuts

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