tourze / deep-seek-api-bundle
DeepSeek API integration bundle for Symfony
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
pkg:composer/tourze/deep-seek-api-bundle
Requires
- doctrine/collections: ^2.3
- doctrine/data-fixtures: ^2.0
- doctrine/dbal: ^4.0
- doctrine/doctrine-bundle: ^2.13
- doctrine/orm: ^3.0
- doctrine/persistence: ^4.1
- easycorp/easyadmin-bundle: ^4
- knplabs/knp-menu: ^3.7
- monolog/monolog: ^3.1
- psr/log: ^3|^2|^1
- symfony/cache: ^7.3
- symfony/cache-contracts: ^3
- symfony/config: ^7.3
- symfony/console: ^7.3
- symfony/dependency-injection: ^7.3
- symfony/doctrine-bridge: ^7.3
- symfony/event-dispatcher: ^7.3
- symfony/expression-language: ^7.3
- symfony/framework-bundle: ^7.3
- symfony/http-client: ^7.3
- symfony/http-client-contracts: ^3.6
- symfony/http-foundation: ^7.3
- symfony/http-kernel: ^7.3
- symfony/lock: ^7.3
- symfony/messenger: ^7.3
- symfony/property-access: ^7.3
- symfony/routing: ^7.3
- symfony/string: ^7.3
- symfony/validator: ^7.3
- symfony/yaml: ^7.3
- tourze/bundle-dependency: 1.*
- tourze/doctrine-async-insert-bundle: 1.0.*
- tourze/doctrine-timestamp-bundle: 1.1.*
- tourze/easy-admin-menu-bundle: 1.0.*
- tourze/http-client-bundle: 1.1.*
- tourze/open-ai-contracts: 1.0.*
- tourze/symfony-dependency-service-loader: 1.0.*
- tourze/symfony-routing-auto-loader-bundle: 1.0.*
Requires (Dev)
This package is auto-updated.
Last update: 2025-11-16 09:25:26 UTC
README
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'); } }