Skip to content

feat(cli): Add --auth to bill a turn to a chosen credential - #1153

Open
JeanMertz wants to merge 3 commits into
pr4-openai-authfrom
pr5-auth-flag
Open

JeanMertz wants to merge 3 commits into
pr4-openai-authfrom
pr5-auth-flag

Conversation

@JeanMertz

@JeanMertz JeanMertz commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

jp q --auth personal bills the turn to that credential, --auth api_key
to per-token billing, and --auth sub,api_key tries the subscription
first. It takes the same entries as the auth chain in configuration.

The flag applies to the provider the turn's model belongs to and records a
config delta, so the rest of the conversation bills the same way until
another --auth changes it.

@JeanMertz
JeanMertz added this pull request to stack #1154 September 10, 2026 11:33
@JeanMertz JeanMertz changed the title pr5 auth flag feat(cli): Add --auth to bill a turn to a chosen credential Sep 10, 2026
@JeanMertz
JeanMertz force-pushed the pr5-auth-flag branch 2 times, most recently from 3f94dab to 03045fc Compare September 13, 2026 05:39
`jp q --auth personal` bills the turn to that credential, `--auth api_key`
to per-token billing, and `--auth sub,api_key` tries the subscription
first. It takes the same entries as the `auth` chain in configuration.

The flag applies to the provider the turn's model belongs to and records a
config delta, so the rest of the conversation bills the same way until
another `--auth` changes it.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
The flag picks which provider's chain to write by following the turn's
model, and nothing pinned that. These cover the resolution: a plain model
id, an alias, an alias naming another alias, the CLI's model winning over
the config layers', and the config layers answering when the CLI names no
model.

Three cases are about refusing rather than resolving. An alias cycle gives
up at a bounded depth instead of recursing forever, a provider reached over
a local socket is refused by name, and a turn with no provider at all
reports the `--cfg` form that would have worked.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant