This repository contains comprehensive PHP examples for interacting with the Venice AI API. Each example is designed to be self-contained and demonstrate every available parameter and option, eliminating the need to constantly refer to external documentation.
These examples draw from and complement the following official Venice AI resources:
The examples in this repository follow these principles:
-
Comprehensive Coverage: Each example demonstrates every available parameter for its endpoint, not just the common ones. This means you can find working examples of any feature without needing to search through documentation.
-
Self-Contained: Examples include all necessary setup and configuration, making it easy to get started.
-
Educational: Code is thoroughly documented with explanations of each parameter and its effects.
-
Production-Ready: Examples follow best practices and include proper error handling.
- Clone this repository
- Copy
config.example.php
toconfig.php
- Add your Venice AI API key to
config.php
- Run any example:
php examples/[category]/[example].php
examples/images/basic_generation.php
: Demonstrates all image generation parameters including model selection, dimensions, steps, style presets, etc.examples/images/upscaling.php
: Shows image upscaling with various scale factorsexamples/images/analyze_image.php
: Demonstrates image analysis capabilities
examples/text/basic_chat.php
: Basic chat completion with all available parametersexamples/text/advanced_chat.php
: Advanced chat features including system promptsexamples/text/streaming.php
: Streaming chat completions
examples/models/list_models.php
: List and filter available modelsexamples/models/filter_models.php
: Advanced model filtering and selection
examples/workflows/image_analysis.php
: Combined image generation and analysisexamples/workflows/story_illustration.php
: Text-to-image story creation
Contributions are welcome! Please ensure any new examples follow our philosophy of being comprehensive and self-contained.
This project is licensed under the MIT License - see the LICENSE file for details.