Documentation
¶
Overview ¶
Package usage supplies shared provider account readers without acquiring credentials.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadVerified ¶
func ReadVerified(ctx context.Context, access func(context.Context) (Access, error), reader Reader) (wire.AccountUsageResponse, error)
ReadVerified publishes usage only while the native credential and route remain the same throughout the provider read.
func RequestError ¶
func RequestError(vendor string, err error) *acp.RequestError
RequestError exposes provider status and retry timing without response bodies or credentials.
Types ¶
type Access ¶
type Access struct {
APIKey string
AccountID string
BaseURL string
Reason string
Fingerprint [32]byte
}
Access identifies the credential and route selected by the native runtime. BaseURL is where the runtime sends the key; Fingerprint covers native routing facts beyond the credential itself.
type Credential ¶
Credential identifies the effective provider account resolved by the native harness. BaseURL is the route the harness sends the token to; a reader that addresses the provider's own endpoint ignores it.
type HTTPError ¶
HTTPError reports an unsuccessful provider read without exposing credentials or bodies.
type Reader ¶
type Reader interface {
Read(context.Context, Credential) (wire.AccountUsageResponse, error)
}
Reader reads the account addressed by the caller's effective provider credential.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package anthropic reads Claude subscription allowances and usage credits.
|
Package anthropic reads Claude subscription allowances and usage credits. |
|
Package gateway reads the aggregate usage report a forwarding gateway publishes for the upstream accounts it brokers.
|
Package gateway reads the aggregate usage report a forwarding gateway publishes for the upstream accounts it brokers. |
|
internal
|
|
|
usagehttp
Package usagehttp bounds authenticated provider usage reads.
|
Package usagehttp bounds authenticated provider usage reads. |
|
Package openaicodex reads ChatGPT subscription allowance windows.
|
Package openaicodex reads ChatGPT subscription allowance windows. |
|
Package opencodego reads OpenCode Go subscription windows.
|
Package opencodego reads OpenCode Go subscription windows. |
|
Package openrouter reads OpenRouter key allowances and account credit balances.
|
Package openrouter reads OpenRouter key allowances and account credit balances. |