Expand description
AI6’s account provider for the API-key kinds: Anthropic API keys, gateway bearer tokens and OpenAI API keys.
§ai6-account-api-key
The api_key_accounts account provider for AI6: an Anthropic API
key (anthropic-api-key), a gateway’s bearer token (anthropic-auth-token) and an OpenAI API key
(codex-api-key). It is the Guatiao account_provider kind, so a Station or any other host of that
kind can load it. See the
API header.
§Features
- The same kind ids, settings schemas and standards as the Claude Code and Codex account providers gave these kinds, so an account made before keeps reading.
- Reads each key’s rate limits with one cheap authenticated request to the account’s own endpoint, and lists the models the key may use by asking Claude Code or Codex once, with no turn.
- A key arrives sealed in the call’s credentials and goes only to that endpoint, to the program’s
environment (Claude Code) or to
codex login --with-api-keyon standard input (Codex). It is in no answer, error, argument or log line.
§Installation
Part of the AI6 workspace; built with it, and loaded by a Station through [station.plugins]:
cargo build -p ai6-account-api-key§Development
cargo test -p ai6-account-api-key
cargo clippy -p ai6-account-api-key --all-targets -- -D warningsThe tests run a stand-in for claude and codex and a loopback server for the rate-limit read; no
account is needed.
§License
MPL-2.0. See LICENSE.
Structs§
- ApiKey
Accounts - API-key accounts as a provider of
account_provider, under the idapi_key_accounts. - ApiKey
Settings - One instance’s settings; every one has a default.
- Claude
Side - What the provider runs and reads for the Claude Code kinds (
anthropic-api-key,anthropic-auth-token). - Codex
Side - What the provider runs and reads for the Codex kind (
codex-api-key).
Constants§
- KINDS
- The kinds this provider serves, with the ids Claude Code’s and Codex’s account providers gave them.
- PROVIDER_
ID - The id the provider is registered under.
Statics§
- guatiao_
declares - What this library declares, read by a scanner as data.
Functions§
- guatiao_
library_ ⚠entry - The symbol a
guatiaohost loads this library by. - offer
- What the provider offers: its three kinds, no way to sign in, usage for each, and no automatic
localaccount.