定制 tourze/deep-seek-api-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tourze/deep-seek-api-bundle

Composer 安装命令:

composer require tourze/deep-seek-api-bundle

包简介

DeepSeek API integration bundle for Symfony

README 文档

README

English | 中文

A Symfony bundle for integrating with DeepSeek API, providing API key management, model listing, and balance checking capabilities.

Features

  • Multiple API key management with automatic rotation
  • List available models for each API key
  • Check account balance in multiple currencies
  • Validate API keys
  • Command-line tools for API interaction

Installation

composer require tourze/deep-seek-api-bundle

Configuration

Configure your API keys in your Symfony configuration:

# config/packages/deep_seek_api.yaml
deep_seek_api:
    api_keys:
        - 'your-api-key-1'
        - 'your-api-key-2'

Commands

Analyze Balance Trends

Analyze balance changes and usage patterns over time.

# Analyze balance for the last 7 days
bin/console deep-seek:analyze-balance

# Analyze balance for specific number of days
bin/console deep-seek:analyze-balance --days=30

# Analyze with specific time interval (hourly, daily, weekly)
bin/console deep-seek:analyze-balance --interval=daily

# Display in specific currency
bin/console deep-seek:analyze-balance --currency=CNY

# Show alerts for significant changes
bin/console deep-seek:analyze-balance --show-alerts

Manage API Keys

Manage DeepSeek API keys including listing, adding, and deactivating.

# List all API keys
bin/console deep-seek:api-key list

# Add a new API key
bin/console deep-seek:api-key add sk-your-api-key --name="Production Key"

# Deactivate an API key
bin/console deep-seek:api-key deactivate sk-your-api-key

# Activate an API key
bin/console deep-seek:api-key activate sk-your-api-key

# Show API key details
bin/console deep-seek:api-key show sk-your-api-key

Check Balance

Check the current balance for all API keys or a specific key.

# Check balance for all keys
bin/console deepseek:balance:check

# Check balance with detailed output
bin/console deepseek:balance:check --verbose

List Models

List all available models from DeepSeek API.

# List models for all keys
bin/console deepseek:models:list

# List models in JSON format
bin/console deepseek:models:list --json

Validate API Key

Validate whether API keys are working correctly.

# Validate all API keys
bin/console deepseek:api-key:validate --all-keys

# Validate specific API key
bin/console deepseek:api-key:validate --key=sk-your-api-key

Sync Data

Synchronize models and balance data from DeepSeek API.

# Sync all data (models and balances)
bin/console deep-seek:sync-data

# Sync only models
bin/console deep-seek:sync-data --models-only

# Sync only balances
bin/console deep-seek:sync-data --balances-only

# Force sync even if recently synced
bin/console deep-seek:sync-data --force

Usage in Code

Using DeepSeekService

use Tourze\DeepSeekApiBundle\Service\DeepSeekService;

class MyService
{
    public function __construct(
        private DeepSeekService $deepSeekService
    ) {}

    public function example(): void
    {
        // List models
        $models = $this->deepSeekService->listModels();
        
        // Check balance
        $balance = $this->deepSeekService->getBalance();
        
        // Validate API key
        $isValid = $this->deepSeekService->validateApiKey('your-api-key');
    }
}

Managing API Keys

use Tourze\DeepSeekApiBundle\Service\ApiKeyManager;

class MyKeyManager
{
    public function __construct(
        private ApiKeyManager $apiKeyManager
    ) {}

    public function example(): void
    {
        // Add a new API key
        $this->apiKeyManager->addApiKey('new-api-key');
        
        // Rotate to next key
        $this->apiKeyManager->rotateToNextKey();
        
        // Get current key
        $currentKey = $this->apiKeyManager->getCurrentKey();
        
        // Mark key as invalid
        $this->apiKeyManager->markKeyAsInvalid('bad-key');
    }
}

tourze/deep-seek-api-bundle 适用场景与选型建议

tourze/deep-seek-api-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 tourze/deep-seek-api-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tourze/deep-seek-api-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 tourze/deep-seek-api-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-16