AI-Mocks

Maven Central

AI-Mocks provides specialized mock server implementations built on top of Mokksy for testing and development with AI provider APIs.

Use Mokksy directly when you need a general HTTP/SSE mock server. Use AI-Mocks when your dependency is an AI provider SDK and you want provider-specific request builders, response formats, streaming behavior, and error payloads.

Supported providers

Feature support matrix

FeatureOpenAIAnthropicGeminiOllamaA2A
Provider request/response mockingChat Completions, ResponsesMessagesGenerate ContentChat, GenerateJSON-RPC A2A endpoints
Streaming responses
Embeddings
Moderation
Additional APIsResponses--GenerateFull A2A Protocol
(11 endpoints)

API details by provider

OpenAI

  • Chat Completions (/v1/chat/completions) - with streaming support
  • Embeddings (/v1/embeddings) - text embedding generation
  • Moderation (/v1/moderations) - content moderation
  • Responses (/v1/responses) - response generation

Anthropic

  • Messages (/v1/messages) - Claude's message API with streaming

Gemini

  • Generate Content - standard content generation
  • Streaming Content - streaming content generation

Ollama

  • Chat (/api/chat) - with streaming support
  • Generate (/api/generate) - text generation with streaming
  • Embeddings (/api/embed) - text embeddings

A2A (Agent-to-Agent Protocol)

  • Agent Discovery - agent card endpoint
  • Message Exchange - send and receive messages with streaming
  • Task Management - create, get, cancel, and resubscribe to tasks
  • Push Notifications - configure task push notifications
  • Full support for A2A Protocol v0.3.0