Documentation
¶
Index ¶
- Constants
- func AuthDir() (string, error)
- func BackendProvider(providerName string) (string, error)
- func ValidateLoginProvider(providerName string) (string, error)
- type LoginOptions
- type LoginResult
- type Runtime
- func Start(parent context.Context, providerName string) (*Runtime, error)
- func StartCodexAPI(parent context.Context, endpoint, upstreamAPIKey, modelSpec string) (*Runtime, error)
- func StartOAuth(parent context.Context, providerName, modelSpec string) (*Runtime, error)
- func StartOpenAIChatAPI(parent context.Context, endpoint, upstreamAPIKey, modelSpec string) (*Runtime, error)
- func StartProvider(parent context.Context, options StartOptions) (*Runtime, error)
- type StartOptions
- type UpstreamProtocol
Constants ¶
const ( ProviderCodex = "codex" ProviderGemini = "gemini" ProviderChatGPT = "chatgpt" )
Variables ¶
This section is empty.
Functions ¶
func BackendProvider ¶
func ValidateLoginProvider ¶
ValidateLoginProvider returns the canonical public OAuth provider name. Codex remains an internal backend and a legacy runtime value, but new logins use the ChatGPT name because both routes authenticate the same account.
Types ¶
type LoginOptions ¶
type LoginResult ¶
func Login ¶
func Login(ctx context.Context, providerName string, opts LoginOptions) (LoginResult, error)
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func StartCodexAPI ¶
func StartCodexAPI(parent context.Context, endpoint, upstreamAPIKey, modelSpec string) (*Runtime, error)
StartCodexAPI starts an embedded CLIProxyAPI runtime configured with a Responses/Codex API-key endpoint. CLIProxyAPI exposes Anthropic Messages and owns the full Claude-to-Responses translation in both directions.
func StartOAuth ¶ added in v1.3.4
func StartOpenAIChatAPI ¶ added in v1.3.4
func StartOpenAIChatAPI(parent context.Context, endpoint, upstreamAPIKey, modelSpec string) (*Runtime, error)
StartOpenAIChatAPI starts CLIProxyAPI with an OpenAI-compatible Chat Completions upstream. CLIProxyAPI owns both request and response translation.
func StartProvider ¶ added in v1.3.4
func StartProvider(parent context.Context, options StartOptions) (*Runtime, error)
StartProvider starts the embedded CLIProxyAPI adapter for every OpenAI-family provider. Claude Code connects directly to the runtime's /v1/messages route.
func (*Runtime) ClaudeBaseURL ¶ added in v1.3.4
ClaudeBaseURL is the origin Claude Code uses before appending /v1/messages. Endpoint includes /v1 because ccl's model and diagnostics clients expect an OpenAI API root.
type StartOptions ¶ added in v1.3.4
type StartOptions struct {
Protocol UpstreamProtocol
Endpoint string
APIKey string
ModelSpec string
OAuthProvider string
}
type UpstreamProtocol ¶ added in v1.3.4
type UpstreamProtocol string
const ( ProtocolOpenAIChat UpstreamProtocol = "openai_chat" ProtocolOpenAIResponses UpstreamProtocol = "openai_responses" )