Class OpenAiCompatibleChatCodec

java.lang.Object
org.mockserver.llm.codec.OpenAiCompatibleChatCodec
All Implemented Interfaces:
ProviderCodec
Direct Known Subclasses:
DeepSeekCodec, GroqCodec, MistralCodec, OpenRouterCodec, XaiCodec

public abstract class OpenAiCompatibleChatCodec extends Object implements ProviderCodec
Base codec for OpenAI-chat-compatible providers (Mistral, xAI/Grok, DeepSeek, Groq, OpenRouter). These providers expose the OpenAI Chat Completions wire format (POST /v1/chat/completions, Authorization: Bearer) on a different host, so — exactly like AzureOpenAiCodec — all encoding and decoding delegates to OpenAiChatCompletionsCodec; only provider() differs per subclass.

Because the wire shape is byte-identical to OpenAI's, the OpenAI golden fixtures cover the response format; these aliases are exercised by OpenAiCompatibleProviderCodecTest instead of dedicated golden files.