CH·02CLI reference

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 deeprelay API 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.

The key is resolved in this order:

  1. the DEEPRELAY_API_KEY environment variable, when set;
  2. ~/.config/deeprelay/credentials.json (written by deeprelay login, mode 0600; $XDG_CONFIG_HOME replaces ~/.config when set).

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

← The gpu CLI