Skip to main content

Crate ai6_account_api_key

Crate ai6_account_api_key 

Source
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

Version Rust version License: MPL-2.0 Docs CI

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-key on 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 warnings

The 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§

ApiKeyAccounts
API-key accounts as a provider of account_provider, under the id api_key_accounts.
ApiKeySettings
One instance’s settings; every one has a default.
ClaudeSide
What the provider runs and reads for the Claude Code kinds (anthropic-api-key, anthropic-auth-token).
CodexSide
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 guatiao host loads this library by.
offer
What the provider offers: its three kinds, no way to sign in, usage for each, and no automatic local account.