Documentation
¶
Overview ¶
Package providerping does the minimum possible real check of whether a configured provider account is actually reachable and authorized right now — a "list models" call (the same convention nearly every one of these APIs supports), never a real completion request. It exists so the CLI's accounts screen can show a real, current status instead of just "a key is set" — a key can be present and still be rate-limited, revoked, or pointed at a provider having an outage, and a chat request is the only way to actually find that out before this existed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Status Status
Latency time.Duration
// Detail is a short, human-readable explanation — empty for a clean
// StatusOK, set for anything else ("429 sem cota", "401 chave
// inválida", "latência alta", ...).
Detail string
}
Result is one provider's current, real status.
func Ping ¶
Ping makes one minimal request against kind's API (anthropic, gemini, openai-compat, or openai-responses) using apiKey, and classifies the result. baseURL, if empty, uses each kind's public default — the same convention internal/provider's adapters already use. Every kind here has exactly one real auth shape (see internal/oauthflow/anthropic.go's doc comment for why an Anthropic account connected via browser login still ends up with a plain, permanent API key rather than needing a second auth mode here).