7.3 企业版功能

OpenCode企业版为大型组织提供额外的安全性、管理能力和部署选项,满足企业级需求。

核心功能

企业版提供以下核心能力:

数据安全

  • 零数据保留 - 会话数据不会被第三方存储
  • 端到端加密 - 所有通信使用TLS 1.3加密
  • 本地处理 - 敏感数据可在本地处理,不外传
  • 审计日志 - 完整的操作审计追踪
  • 数据驻留 - 支持指定数据存储区域

代码所有权

  • 完全所有权 - 生成的代码归属于您的组织
  • 无训练使用 - 您的代码不会用于模型训练
  • 知识产权保护 - 符合企业IP政策要求
  • 许可证合规 - 生成代码的许可证透明

中央配置

企业版支持通过中央配置管理所有用户的OpenCode设置。

配置分发

# 企业配置服务器
export OPENCODE_CONFIG_URL=https://config.company.com/opencode

# 或使用配置文件路径
export OPENCODE_ENTERPRISE_CONFIG=/etc/opencode/enterprise.json

策略定义

{
  "enterprise": {
    "name": "Acme Corporation",
    "policies": {
      "allowedProviders": ["anthropic", "azure-openai"],
      "blockedModels": [],
      "requireApproval": ["write", "execute"],
      "maxTokensPerSession": 100000,
      "sessionRetentionDays": 30
    }
  }
}

用户组配置

{
  "enterprise": {
    "groups": {
      "developers": {
        "permissions": ["read", "write", "execute"],
        "models": ["claude-3-sonnet", "claude-3-haiku"],
        "dailyTokenLimit": 500000
      },
      "architects": {
        "permissions": ["read", "write", "execute", "admin"],
        "models": ["claude-3-opus", "claude-3-sonnet"],
        "dailyTokenLimit": 2000000
      }
    }
  }
}

SSO集成

企业版支持与主流身份提供商集成。

SAML 2.0

{
  "enterprise": {
    "sso": {
      "type": "saml",
      "entryPoint": "https://idp.company.com/sso/saml",
      "issuer": "opencode-enterprise",
      "cert": "/path/to/idp-cert.pem",
      "attributeMapping": {
        "email": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
        "name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
        "groups": "http://schemas.xmlsoap.org/claims/Group"
      }
    }
  }
}

OAuth 2.0 / OIDC

{
  "enterprise": {
    "sso": {
      "type": "oidc",
      "issuer": "https://auth.company.com",
      "clientId": "opencode-client",
      "clientSecret": "${OPENCODE_OIDC_SECRET}",
      "scopes": ["openid", "profile", "email", "groups"],
      "redirectUri": "http://localhost:8080/callback"
    }
  }
}

支持的身份提供商

  • Okta
  • Azure Active Directory
  • Google Workspace
  • OneLogin
  • Auth0
  • 自建LDAP/AD

内部网关

企业可以部署内部网关来管理和监控所有AI请求。

网关架构

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  OpenCode   │────▶│   Gateway   │────▶│  AI Provider │
│   Client    │     │   (内部)    │     │   (外部)     │
└─────────────┘     └─────────────┘     └─────────────┘
                          │
                          ▼
                    ┌─────────────┐
                    │  日志/监控  │
                    └─────────────┘

网关配置

{
  "enterprise": {
    "gateway": {
      "url": "https://ai-gateway.company.internal",
      "apiKey": "${GATEWAY_API_KEY}",
      "features": {
        "rateLimit": true,
        "contentFilter": true,
        "auditLog": true,
        "costTracking": true
      }
    }
  }
}

流量控制

{
  "enterprise": {
    "gateway": {
      "rateLimit": {
        "requestsPerMinute": 60,
        "tokensPerHour": 1000000,
        "concurrentSessions": 10
      },
      "routing": {
        "primary": "anthropic",
        "fallback": "azure-openai",
        "loadBalancing": "round-robin"
      }
    }
  }
}

部署选项

企业版提供多种部署方式:

云托管(SaaS)

  • 由OpenCode团队托管和维护
  • 自动更新和安全补丁
  • 99.9% SLA保证
  • 支持数据驻留选项(美国、欧洲、亚太)

私有云部署

# Kubernetes部署
kubectl apply -f opencode-enterprise.yaml

# Helm安装
helm repo add opencode https://charts.opencode.ai
helm install opencode-enterprise opencode/enterprise \
  --set license.key=${LICENSE_KEY} \
  --set sso.enabled=true

本地部署(On-Premise)

# Docker Compose部署
docker-compose -f docker-compose.enterprise.yml up -d

# 系统要求
# - 最低4核CPU、8GB内存
# - PostgreSQL 14+或MySQL 8+
# - Redis 6+(可选,用于缓存)

混合部署

  • 控制平面可在云端或本地
  • 代理可部署在开发者本机
  • 支持跨区域部署

定价模式

企业版提供灵活的定价选项:

按座位定价

规模价格功能
团队版(5-25人)$20/用户/月SSO、中央配置、基础审计
企业版(26-100人)$15/用户/月+ 网关、高级审计、SLA
大型企业(100+人)联系销售+ 私有部署、定制功能

按用量定价

  • API调用次数计费
  • Token使用量计费
  • 无最低消费
  • 适合用量波动大的团队

年度订阅优惠

  • 年付享受20%折扣
  • 包含优先技术支持
  • 专属客户成功经理
提示
联系 enterprise@opencode.ai 获取详细报价和演示。

合规认证

企业版符合以下合规标准:

  • SOC 2 Type II
  • ISO 27001
  • GDPR
  • HIPAA(医疗行业)
  • FedRAMP(政府机构)

技术支持

企业版客户享受优先支持:

  • 24/7全天候技术支持
  • 专属Slack/Teams频道
  • 季度业务回顾
  • 定制培训服务
  • 优先功能请求

下一步

接下来学习如何排查和解决OpenCode使用中的常见问题。