webboy/deepseek

PHP client for Deepseek AI API

1.0.3 2025-01-27 10:25 UTC

This package is auto-updated.

Last update: 2025-01-27 10:39:35 UTC


README

Latest Stable Version Total Downloads PHP Version License Build Status

A PHP client for interacting with the Deepseek AI API, providing easy-to-use methods to communicate with Deepseek's services.

Installation

Install the package via Composer:

composer require webboy/deepseek

Requirements

PHP ^8.1

ext-json extension

ext-curl extension

Features

  • Easy integration with Deepseek AI API

  • Utilizes Guzzle for HTTP requests

  • Simple and fluent API for request handling

  • Laravel-friendly using illuminate/collections

Usage

Initialize the client

use Webboy\Deepseek\Deepseek;

$deepseek = new Deepseek('your-api-key');

Get all models

$response = $client
    ->listModels()
    ->call();

Get user balance

$response = $client
    ->getBalance()
    ->call();

Start a chat session

$response = $client
        ->createChatCompletion()
        ->setResponseFormat('text')
        ->setSystemMessage('You are a professional LinkedIn influencer.', 'Agent Smith')
        ->setUserMessage('Write down a short announcement for the initial version for the Deepseek API Client composer package.')
        ->call();