Create scoped bearer credentials for CI, scripts, services, and non-interactive agents.
Use API keys when automation can’t complete a browser login. They authenticate with bearer auth, skip CSRF checks, and carry explicit scopes — so each job gets exactly the access it needs and nothing more.
Provide the token through an environment variable, or pipe it in over stdin to keep it off the process list.
export AGENT_ARTIFACTS_BASE_URL="https://api.example.com"export AGENT_ARTIFACTS_TOKEN="aa_k_..."# whoami resolves the key's owner — including your username — so you don't need# to know it out of band. --owner is optional on push; when omitted the API# infers it from the key.artifacts whoami --format jsonartifacts push --project-slug default --file ./report.md --no-input
set -euo pipefailexport AGENT_ARTIFACTS_BASE_URL="https://api.example.com"export AGENT_ARTIFACTS_NO_INPUT=1bun run build:report# --owner is inferred from the key; pass it only to publish into another account.artifacts push \ --token "$AGENT_ARTIFACTS_TOKEN" \ --project-slug ci \ --file ./out/report.html \ --title "CI report for $GITHUB_SHA" \ --private \ --format json