Observability for MiniMax with Opik
MiniMax provides OpenAI-compatible and Anthropic-compatible APIs for its language models. Opik can trace either protocol by wrapping the corresponding Python SDK client.
Install the dependencies
Install Opik and the SDK for the protocol you plan to use:
Configure Opik for your deployment:
Set your MiniMax API key:
Choose an endpoint
Use the endpoint for your account region and SDK protocol:
You can find additional API details in the global MiniMax documentation or the China MiniMax documentation.
Track OpenAI-compatible calls
Wrap the OpenAI client with track_openai and pass the MiniMax base URL:
For a China account, change base_url to https://api.minimaxi.com/v1.
Track Anthropic-compatible calls
Wrap the Anthropic client with track_anthropic and pass the MiniMax base URL:
For a China account, change base_url to https://api.minimaxi.com/anthropic.
Model identifiers
Use the model identifier exposed by your MiniMax account. Current text model identifiers include:
MiniMax-M3MiniMax-M2.7
The wrapped clients preserve the normal SDK response objects while Opik records the request, response, token usage, and model metadata.