Skip to main content

iFlow Provider

Access iFlow AI models through OAuth authentication with Device Code flow. Seamless integration with Claude Code for instant model switching.

Overview

The iFlow provider enables Claude Code to use iFlow’s AI platform through OAuth authentication. Uses Device Code flow for secure, headless-friendly authentication. Provider Identifier: iflow Command: ccs iflow Supported Models:
  • Various models available via iFlow platform
  • Model selection configurable via CLIProxy settings

Authentication

First-Time Setup

# Run iFlow for the first time
ccs iflow "review this code"

# Device Code flow starts automatically
# → Display device code + verification URL
# → User manually authorizes in browser
# → CLIProxyAPI polls for token completion
# → Token cached at ~/.ccs/cliproxy/auth/
# → Future runs require no re-auth
Device Code Flow:
  1. CCS displays device code and verification URL
  2. User opens URL in any browser
  3. Enter device code to authorize
  4. Token automatically cached when complete
  5. No callback server required (more secure)
Example Output:
Authenticate with iFlow:
1. Open https://iflow.ai/device
2. Enter code: WXYZ-5678
3. Authorize CCS CLI access

Waiting for authorization...

Manual Authentication

# Authenticate without starting a session
ccs iflow --auth

# Headless mode (server/SSH environments)
# Device Code flow works naturally in headless - no special flag needed
ccs iflow --auth
# → Displays URL + code for manual browser authentication

Logout

# Clear all iFlow tokens
ccs iflow --logout

Multi-Account Support

Manage multiple iFlow accounts for different projects:

Add Account

# Add new account (preserves existing)
ccs iflow --auth --add

List Accounts

# Show all authenticated iFlow accounts
ccs iflow --accounts

# Output:
# Accounts for iflow:
#   [default] work (work@company.com)
#   personal (personal@example.com)

Switch Account

# Switch to specific account by nickname
ccs iflow --use personal

# Next command uses personal's account
ccs iflow "your prompt"

Rename Account

# Rename default account nickname
ccs iflow --nickname primary-account
Account Registry: ~/.ccs/cliproxy/accounts.json Auto-Nicknames: Generated from email prefix (e.g., john@example.comjohn)

Configuration Options

Model Settings

iFlow provider settings stored in: Path: ~/.ccs/iflow.settings.json Configuration via Dashboard:
# Open web config interface
ccs config

# Navigate to CLIProxy → iFlow settings
Manual Configuration:
{
  "env": {
    "ANTHROPIC_MODEL": "iflow-model-name",
    "ANTHROPIC_MAX_TOKENS": "8192"
  }
}

CLIProxy Integration

iFlow integrates with unified CLIProxy config: Path: ~/.ccs/cliproxy/config.yaml Provider Routing: Requests routed to /api/provider/iflow endpoint Concurrent Usage: Run iFlow + other providers simultaneously without conflicts

Commands

Basic Usage

# Run with iFlow
ccs iflow "analyze this database schema"

# Interactive chat
ccs iflow

Authentication Flags

FlagDescription
--authTrigger OAuth flow (no session)
--logoutClear all tokens
--auth --addAdd new account (keep existing)

Account Management Flags

FlagDescription
--accountsList all accounts
--use <nickname>Switch default account
--nickname <name>Rename default account

Storage Locations

PathPurpose
~/.ccs/cliproxy/auth/iflow-*.jsonOAuth tokens (one per account)
~/.ccs/cliproxy/accounts.jsonAccount registry with nicknames
~/.ccs/iflow.settings.jsonProvider-specific settings
~/.ccs/cliproxy/config.yamlCLIProxy unified config

Token Management

Storage Format:
{
  "type": "iflow",
  "access_token": "...",
  "refresh_token": "...",
  "email": "user@example.com",
  "expired": "2024-12-31T23:59:59Z"
}
Auto-Refresh: Tokens managed by CLIProxyAPI Security: Device Code flow prevents token interception (no callback server)

Device Code Flow Details

Why Device Code?
  • More secure (no callback server listening on local port)
  • Works seamlessly in headless environments
  • No port conflicts or firewall issues
  • User completes auth on trusted device
Flow Timeline:
  1. CCS requests device code from iFlow API
  2. Displays code + URL to user
  3. User authorizes in browser (any device)
  4. CCS polls iFlow API for token availability
  5. Token saved when authorization complete
Callback Port: null (no server required)

Requirements

  • iFlow subscription/account
  • Browser for OAuth (on any device - not necessarily same machine)
  • Network access to iFlow authentication servers

Troubleshooting

Device Code Expired

Error: “Device code expired before authorization” Solution: Device codes expire after 10-15 minutes. Re-run ccs iflow --auth to get new code.

Authorization Not Detected

# Verify token file exists
ls ~/.ccs/cliproxy/auth/iflow-*.json

# Re-authenticate if missing
ccs iflow --logout
ccs iflow --auth

Multi-Account Issues

# List all accounts to verify state
ccs iflow --accounts

# Switch to specific account
ccs iflow --use <nickname>

Token Expiry

Tokens refresh automatically via CLIProxyAPI. If refresh fails:
# Re-authenticate
ccs iflow --auth

Cost Information

iFlow Subscription/Account Required: Check iflow.ai for current pricing and subscription options Usage Limits: Subject to iFlow’s rate limits and subscription tier

Next Steps