Skip to main content

iFlow Provider

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

Overview

The iFlow provider enables Claude Code to use iFlow’s AI platform through Browser OAuth authentication with callback server on port 11451. 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"

# Browser OAuth flow starts automatically
# → Browser opens for iFlow OAuth consent
# → Callback server spawns on port 11451
# → Token cached at ~/.ccs/cliproxy/auth/
# → Future runs require no re-auth
Browser OAuth Flow:
  1. Authorization Code flow via browser callback
  2. Callback server spawns on port 11451
  3. Browser opens for iFlow OAuth consent
  4. Token received via HTTP callback
  5. Auto-refresh prevents mid-request failures
Example Output:
Authenticate with iFlow:
Opening browser for OAuth authentication...
Callback server listening on port 11451...

Browser opened for authentication.

Manual Authentication

# Authenticate without starting a session
ccs iflow --auth

# Headless mode (server/SSH environments)
ccs iflow --headless
# → Displays URL for manual browser authentication
# → Includes SSH tunnel instructions if needed

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

Model Alias Normalization

Available since v7.51.0
CCS automatically normalizes legacy iFlow model IDs to their canonical equivalents. This prevents 406/404 errors when iFlow’s API updates model naming. Known mappings:
Legacy Model IDCanonical Model ID
kimi-k2.5kimi-k2
deepseek-v3.2-chatdeepseek-v3.2
glm-4.7glm-4.6
minimax-m2.5qwen3-coder-plus
These mappings are applied automatically — no config change required. If you have ANTHROPIC_MODEL set to a legacy alias in your iFlow settings, it will continue to work.

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

Multi-Account Setup

Manage multiple iFlow accounts

Dashboard Config

Configure via web interface