Claude 3 Api banner
claude-php claude-php

Claude 3 Api

AI community

Description

Claude 3 API PHP Package: Seamlessly integrate Anthropic's Claude 3 AI into your PHP projects. Features simple chat interface, advanced message handling, vision capabilities, streaming support, and tool usage. Ideal for text processing, image analysis, and complex AI tasks. Fully tested and error-handled.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Claude 3 API PHP Package

**⚠️ DEPRECATION NOTICE**

**This package is deprecated and no longer maintained.**

Please migrate to the newer [Claude PHP SDK](https://github.com/claude-php/Claude-PHP-SDK), which provides:

  • Like-for-like parity with the official Claude Python SDK
  • Full support for all Claude API features including:
    • Messages API with streaming
    • Tool use and function calling
    • Prompt caching
    • Vision capabilities
    • Batch processing (50% cost savings)
    • Beta features (extended output, structured outputs, thinking mode)
    • Token counting
  • Comprehensive documentation and examples
  • Active maintenance and updates
  • Framework integration guides (Laravel, Symfony)

**Migration Guide:** Visit the [Claude PHP SDK repository](https://github.com/claude-php/Claude-PHP-SDK) for installation instructions and documentation.


A robust PHP package for interacting with Anthropic's Claude 3 API, supporting both text and vision capabilities.

Features

  • Easy-to-use interface for sending messages to Claude (default), OpenAI and DeepSeek
  • Support for text-based conversations with a simple chat method
  • Streaming support for real-time responses
  • Vision capabilities - send images along with text prompts (Claude only)
  • Tool usage support (Claude only)
  • Prompt caching support for improved performance and cost efficiency (Claude only)
  • Comprehensive error handling
  • Fully tested with PHPUnit

Installation

You can install the package via composer:

composer require claude-php/claude-3-api

Usage

Basic Chat Usage

For simple text-based interactions, you can use the `chat` method:

Basic Chat Usage

For simple text-based interactions, you can use the `chat` method in several ways:

  1. Send a single string message:
use Claude\Claude3Api\Client;
use Claude\Claude3Api\Config;

// Create a configuration object with your A