deeprelay auth token
Print your API key for tools such as Claude Code's apiKeyHelper
Print your API key for tools such as Claude Code's apiKeyHelper
Synopsis
Prints your CLI inference key to stdout, followed by a newline, and nothing else. It exists so other tools can fetch the key at the moment they need it instead of storing a copy in their own config.
deeprelay login creates two keys. This command prints the CLI inference key — a standard key that cannot manage keys — so a tool configured with it can call models but can never create, change or revoke API keys. The login key stays private to the CLI: the deeprelay commands use it, and it is never printed.
The key is resolved in this order:
- the
DEEPRELAY_API_KEYenvironment variable, when set; - the inference key in
~/.config/deeprelay/credentials.json(written bydeeprelay login, mode 0600;$XDG_CONFIG_HOMEreplaces~/.configwhen set).
If your credentials file predates the two-key login and holds only a login key, the first run creates the inference key (named CLI inference (), saves it to the same file and prints it; later runs read it from the file. If that fails — for example because the stored key is not allowed to manage keys — the command tells you to run deeprelay login.
Stdout carries only the key, so it can be read verbatim by another program. When no key can be found — you are logged out, or the credentials file has an empty key — the command prints an error to stderr telling you to run deeprelay login and exits non-zero. It never prints an empty key.
Claude Code
deeprelay setup claude-code points Claude Code's apiKeyHelper setting at this command, so your key stays in the deeprelay credentials file and never appears in Claude Code's settings.json. Setup writes the absolute path of the deeprelay binary it was run from, so Claude Code never finds the command through PATH:
{
"apiKeyHelper": "/usr/local/bin/deeprelay auth token"
}
If you move or reinstall deeprelay to a different location, run deeprelay setup claude-code again to update the path.
Examples
# Print the key (for another program to read)
deeprelay auth token
# Check that a key resolves without showing it
deeprelay auth token >/dev/null && echo "logged in"
Security note: the key is printed in plain text. Do not run this command in a shared screen, a recorded terminal session, or a CI log that others can read.
deeprelay auth token [flags]
Options
-h, --help help for token
Options inherited from parent commands
--api-base string API base URL (override with DEEPRELAY_API_BASE env) (default "https://api.deeprelay.ai/v1")
--debug Enable debug logging to stderr
--no-preflight Skip the plan/credit check before inference requests (override with DEEPRELAY_NO_PREFLIGHT env)
-o, --output string Output format: table|json (default table on TTY, json otherwise) (default "table")
SEE ALSO
- deeprelay auth - Manage how other tools get your deeprelay credentials