# Protify AI -- Open-Source Java AI SDK (Full Reference) ## Summary Protify AI is an open-source Java SDK (Apache 2.0) that provides a unified API for 13+ AI providers including OpenAI, Anthropic, Gemini, Mistral, Groq, DeepSeek, and more. Built by Protify Consulting LLC, it has zero external dependencies, requires Java 11+, and supports single requests, multi-turn conversations, streaming, pipeline orchestration, tool use, MCP, declarative AI services, and structured output. ## Contact - Email: jkuryla@protify.com - Website: https://protify.ai - GitHub: https://github.com/protifyconsulting/protifyai-java - Company: Protify Consulting LLC (https://protify.com) — a technology consulting firm providing fractional CTO services, technology strategy, AI-enhanced application development, and software process leadership ## Features in Detail ### Single Requests One-shot AI calls with text, images, and PDFs. Structured output deserializes JSON responses directly into Java objects. Simple builder pattern for constructing requests. ### Multi-Turn Conversations Stateful dialogue with full message history. Pluggable persistence lets any service instance resume any conversation. Conversations maintain context across multiple exchanges. ### Pipeline Orchestration Chain sequential, parallel, conditional, loop, and retry steps -- each targeting a different AI provider. Compose pipelines inside pipelines. Get per-step token stats. Supports complex multi-model workflows. ### Streaming Real-time token-by-token output from any request or pipeline. Register listeners and get the full response when complete. Works with all providers. ### Tool Use & MCP Define tools, detect tool calls, run manual or automatic tool loops. Connect to MCP servers via stdio or HTTP transport. Full function calling support across providers. ### Zero Dependencies Uses only java.net.http and built-in JSON. Drop it into any Java project -- microservice, Android, CLI, legacy monolith. No framework lock-in. ### Declarative AI Services Define annotated interfaces and let the SDK generate implementations via JDK proxies. Template variables, automatic return type mapping, streaming, and async -- zero boilerplate. ### Provider Agnostic 13 built-in providers -- OpenAI, Anthropic, Gemini, Mistral, Groq, DeepSeek, Together, Fireworks, xAI, Azure OpenAI, Vertex AI, AWS Bedrock, and Azure AI Foundry. Swap with a single config change. Pluggable interface for custom providers. ### Resilience Built In Configurable retry policies with exponential backoff, jitter, status code filtering, and Retry-After header support. Production-ready error handling. ### Configuration Hierarchy Four-level config cascade: base > client > pipeline > request. Override at any level with full control. Flexible and composable configuration. ## Supported Providers 1. OpenAI -- GPT-5 family 2. Anthropic -- Claude 4 family 3. Google Gemini -- Gemini Pro & Flash 4. Mistral -- Mistral Large & Small 5. Groq -- Ultra-fast inference 6. DeepSeek -- DeepSeek V3 & R1 7. Together -- Open-source models 8. Fireworks -- Optimized inference 9. xAI -- Grok models 10. Azure OpenAI -- Enterprise deployments 11. Google Vertex AI -- GCP managed 12. AWS Bedrock -- AWS managed 13. Azure AI Foundry -- Azure managed 14. Custom -- Any LLM API via pluggable interface ## Quick Start ### Gradle ``` implementation 'ai.protify:protifyai:0.1.9' ``` ### Maven ```xml ai.protify protifyai 0.1.9 ``` ### Basic Usage ```java import ai.protify.ai.*; public class App { public static void main(String[] args) { AIClient client = AIClient.builder() .model(AIModel.CLAUDE_SONNET_4_6) .build(); AIResponse response = client.newRequest() .addInput("What is the capital of France?") .build() .execute(); System.out.println(response.text()); } } ``` ## Architecture Your Application > Protify AI SDK (AIClient, AIRequest, AIConversation, AIPipeline, AITool, MCPClient > Config, Pipeline Engine, HTTP, JSON) > Providers (OpenAI, Anthropic, Gemini, Mistral, Groq, DeepSeek, Together, Fireworks, xAI, Azure OpenAI, Vertex AI, AWS Bedrock) ## Stats - 0 external dependencies - 4 interaction patterns - 0 frameworks required - Java 11+ minimum version - 13+ providers supported ## Pages - Home: https://protify.ai/