PHPackages                             dikki/claude-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dikki/claude-sdk

AbandonedArchivedLibrary[API Development](/categories/api)

dikki/claude-sdk
================

A powerful PHP SDK for Anthropic's Claude API

1.0.3(1y ago)661MITPHPPHP &gt;=8.2

Since Jul 22Pushed 1y agoCompare

[ Source](https://github.com/namankumar80510/claude-sdk)[ Packagist](https://packagist.org/packages/dikki/claude-sdk)[ RSS](/packages/dikki-claude-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (7)Versions (9)Used By (0)

Claude API PHP SDK
==================

[](#claude-api-php-sdk)

[![PHP Version](https://camo.githubusercontent.com/187240af044d09d5b14a1d9d9ebdf3f7a993e4c7bc09bdb46b4ba661a891bf5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d626c7565)](https://camo.githubusercontent.com/187240af044d09d5b14a1d9d9ebdf3f7a993e4c7bc09bdb46b4ba661a891bf5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d626c7565)

[![Example Screenshot](https://camo.githubusercontent.com/43457f91fbac9a9492aa0c10b3cbf1155b540f0c41cb31ecc35a7d527327b86e/68747470733a2f2f636c617564652e796f6a616e616d6167617a696e652e6f6e6c696e652f696d616765732f6578616d706c652e6a7067)](https://camo.githubusercontent.com/43457f91fbac9a9492aa0c10b3cbf1155b540f0c41cb31ecc35a7d527327b86e/68747470733a2f2f636c617564652e796f6a616e616d6167617a696e652e6f6e6c696e652f696d616765732f6578616d706c652e6a7067)

This is a useful PHP library that you can use to communicate with Anthropic's Claude via API.

The new version of the library is a complete rewrite and hence is not backward compatible with the previous version. Previous methods of getResponse and getTextResponse have been removed.

You can checkout the [documentation on the website](https://claude.yojanamagazine.online/).

Features
--------

[](#features)

- Support for all Claude models (Claude 3 Opus/Sonnet/Haiku, Claude 2.1)
- Streaming responses for real-time output
- Async request support using Promises
- Type-safe request/response handling
- Configurable request parameters (temperature, max tokens, etc)
- Comprehensive error handling and validation
- CLI tool for quick testing and API checks

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Composer
- Valid Anthropic API key

Installation
------------

[](#installation)

```
composer require dikki/claude-sdk
```

Usage
-----

[](#usage)

```
