Skip to content

Authentication

RestFlow supports multiple authentication providers for AI services. This guide covers how to configure and manage authentication profiles.

ProviderDescriptionToken FormatUse Case
claude-codeClaude Code CLI OAuthsk-ant-oat01-...restflow claude command
anthropicAnthropic APIsk-ant-api03-...Direct API calls
openaiOpenAI APIsk-...OpenAI models
googleGoogle Gemini APIAPI keyGemini models
Terminal window
restflow auth list

Example output:

+----------+-------------------+------------+-------------+---------+-----------+
| ID | Name | Provider | Source | Health | Available |
+===============================================================================+
| 207a9150 | Claude Code OAuth | ClaudeCode | Manual | Healthy | yes |
| ff2717f1 | $OPENAI_API_KEY | OpenAI | Environment | Unknown | yes |
+----------+-------------------+------------+-------------+---------+-----------+
Terminal window
restflow auth add --provider <PROVIDER> --key <KEY> [--name <NAME>]

Options:

OptionDescriptionRequired
--providerProvider type (see table above)Yes
--keyAPI key or OAuth tokenYes
--nameDisplay name for the profileNo
Terminal window
restflow auth show <ID>
Terminal window
restflow auth remove <ID>
Terminal window
restflow auth status

Automatically discover credentials from environment variables and other sources:

Terminal window
restflow auth discover

Run the Claude Code setup command to generate an OAuth token:

Terminal window
claude setup-token

This will:

  1. Open your browser for authentication
  2. Generate a long-lived OAuth token (valid for 1 year)
  3. Display the token: sk-ant-oat01-...
Terminal window
restflow auth add \
--provider claude-code \
--key "sk-ant-oat01-YOUR_TOKEN_HERE" \
--name "My Claude Code"
Terminal window
# Check profile is available
restflow auth list
# Test with claude command
restflow claude -p "Say hello"

For direct API access (not Claude Code CLI):

Terminal window
restflow auth add \
--provider anthropic \
--key "sk-ant-api03-YOUR_API_KEY" \
--name "My Anthropic API"
Terminal window
restflow auth add \
--provider openai \
--key "sk-YOUR_OPENAI_KEY" \
--name "My OpenAI"

Or set via environment variable (auto-discovered):

Terminal window
export OPENAI_API_KEY="sk-YOUR_OPENAI_KEY"
restflow auth discover

RestFlow automatically discovers credentials from these environment variables:

VariableProvider
OPENAI_API_KEYOpenAI
ANTHROPIC_API_KEYAnthropic
GOOGLE_API_KEYGoogle

Profiles track health status for automatic failover:

StatusDescription
HealthyWorking correctly
UnknownNot yet tested
CooldownTemporarily unavailable (rate limited)
DisabledPermanently disabled

”No available ClaudeCode auth profile found”

Section titled “”No available ClaudeCode auth profile found””

You need to add a Claude Code profile:

Terminal window
# First, get a token
claude setup-token
# Then add it to RestFlow
restflow auth add --provider claude-code --key "sk-ant-oat01-..." --name "Claude Code"

Make sure you’re using the correct token type:

  • Claude Code CLI: Use sk-ant-oat01-... (OAuth token) with --provider claude-code
  • Anthropic API: Use sk-ant-api03-... (API key) with --provider anthropic

Check profile status:

Terminal window
restflow auth show <ID>

If in cooldown, wait for the cooldown period to expire, or manually enable:

Terminal window
# The profile may need to be re-added if disabled
restflow auth remove <ID>
restflow auth add --provider ... --key ...