> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ccs.kaitran.ca/llms.txt
> Use this file to discover all available pages before exploring further.

# API Profiles

> Create custom API key profiles for any Anthropic-compatible endpoint

# API Profiles

API profiles let you use any Anthropic-compatible endpoint by configuring a base URL, API key, and model. No OAuth required.

## Available Presets

| Preset                | Command          | Default Model                | Context | Category    |
| --------------------- | ---------------- | ---------------------------- | ------- | ----------- |
| `anthropic`           | `ccs anthropic`  | `claude-sonnet-4-5-20250929` | 200K    | Recommended |
| `alibaba-coding-plan` | `ccs albb`       | `qwen3-coder-plus`           | 1M      | Recommended |
| `llamacpp`            | `ccs llamacpp`   | `llama3-8b`                  | Varies  | Recommended |
| `ollama`              | `ccs ollama`     | `qwen3-coder`                | 32K+    | Recommended |
| `openrouter`          | `ccs openrouter` | 300+ models                  | Varies  | Alternative |
| `novita`              | `ccs novita`     | `deepseek/deepseek-v3.2`     | Varies  | Alternative |
| `minimax`             | `ccs mm`         | `MiniMax-M3`                 | 1M      | Alternative |
| `glm` (built-in)      | `ccs glm`        | `glm-5.2`                    | 1M      | Built-in    |
| `km` (built-in)       | `ccs km`         | `kimi-for-coding`            | Varies  | Built-in    |

## Creating Profiles

### Via Preset

```bash theme={null}
# Interactive wizard — prompts for name and API key
ccs api create --preset anthropic
ccs api create --preset alibaba-coding-plan
ccs api create --preset ollama
ccs api create --preset llamacpp
ccs api create --preset novita
ccs api create --preset openrouter
```

### Via Dashboard

```bash theme={null}
ccs config
# Navigate to: API Profiles → Create Profile → select preset
```

### Manual Settings File

Create `~/.ccs/<name>.settings.json`:

```json theme={null}
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://your-endpoint.com/v1",
    "ANTHROPIC_AUTH_TOKEN": "your-api-key",
    "ANTHROPIC_MODEL": "model-name",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "model-name",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "model-name",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-name"
  }
}
```

Register in `~/.ccs/config.yaml`:

```yaml theme={null}
profiles:
  myprofile:
    settings_file: ~/.ccs/myprofile.settings.json
```

<Warning>
  All `env` values must be strings. Booleans or objects cause crashes on Windows PowerShell.
</Warning>

## CLIProxy Bridge

Use OAuth providers as API profiles via the CLIProxy bridge:

```bash theme={null}
ccs api create --cliproxy-provider gemini
ccs api create --cliproxy-provider codex
```

This creates an API profile that routes through the local CLIProxy instance, giving you API-key-style access to OAuth providers.

## Profile Lifecycle

```bash theme={null}
# List all API profiles
ccs api list

# Copy a profile with new name
ccs api copy glm glm-backup

# Export (without secrets by default)
ccs api export glm --out glm-export.json
ccs api export glm --out glm-export.json --include-secrets

# Import from file
ccs api import glm-export.json
ccs api import glm-export.json --name glm-restored

# Find unregistered settings files
ccs api discover
ccs api discover --register

# Remove profile
ccs api remove myprofile
```

## Extended Context (`--1m` flag)

Some profiles support a 1M token context window:

```bash theme={null}
# Enable 1M context for this session
ccs albb --1m "analyze entire codebase"
ccs km --1m "read all these files"

# Disable if auto-enabled
ccs albb --no-1m "quick task"
```

Profiles with 1M support: `alibaba-coding-plan`, `km`, `kimi`, `minimax`.

## Settings File Format

Full settings file with all optional fields:

```json theme={null}
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.example.com",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-key",
    "ANTHROPIC_MODEL": "model-id",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "model-id",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "model-id",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-id",
    "ANTHROPIC_MAX_TOKENS": "8192",
    "ANTHROPIC_THINKING_BUDGET": "8192"
  }
}
```

## Common Profiles

### Z.AI GLM (`ccs glm`)

```json theme={null}
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "your_glm_api_key",
    "ANTHROPIC_MODEL": "glm-5.2"
  }
}
```

### Kimi for Coding (`ccs km`)

```json theme={null}
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.kimi.com/coding/",
    "ANTHROPIC_AUTH_TOKEN": "your_kimi_api_key",
    "ANTHROPIC_MODEL": "kimi-for-coding"
  }
}
```

## Hybrid Workflow

Combine Claude subscriptions with API profiles for cost-optimized workflows:

```bash theme={null}
# Terminal 1: Strategic design with Claude (subscription)
ccs "design the authentication architecture"

# Terminal 2: Bulk implementation with GLM (API key, low cost)
ccs glm "implement all the services per the design"

# Terminal 3: Review with Codex (OAuth, no API key)
ccs codex "security review of the implementation"
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Anthropic Direct" icon="a" href="/providers/api/anthropic-direct">
    Direct API access with your Anthropic key
  </Card>

  <Card title="Alibaba Coding Plan" icon="code" href="/providers/api/alibaba">
    Qwen3 Coder with 1M context
  </Card>

  <Card title="Ollama (Local)" icon="box" href="/providers/api/ollama">
    Zero-cost local model inference
  </Card>

  <Card title="llama.cpp (Local)" icon="microchip" href="/providers/api/llamacpp">
    GGUF models with GPU acceleration
  </Card>
</CardGroup>
