Setting Up MiniMax-M3 in Prime Agent
If you're trying to use the MiniMax M3 model with Prime Agent and getting cryptic errors like `No API provider registered for api: anthropic` or `Model not found: minimax/MiniMax-M3`, this guide walks you through the fix.
## The Problem
Prime Agent's `models.json` configuration file has a few gotchas that aren't obvious from the documentation. After a few rounds of debugging, here are the three things that need to be correct:
1. The **`api` field** must be one of the values Prime Agent actually recognizes (`anthropic-messages`, `openai-completions`, `openai-responses`).
2. The **`baseUrl`** must match the API protocol you're using.
3. The **provider name** in `models.json` must match the one referenced in `settings.json`.
Get any of these wrong and you get a frustrating error that doesn't immediately point to the cause.
## Understanding MiniMax's API
[MiniMax](https://platform.minimax.io) exposes two API protocols, each on a different base URL:
| Protocol | Base URL | Prime Agent `api` value |
|---------------|-----------------------------------|-------------------------|
| Anthropic API | `https://api.minimax.io/anthropic` | `anthropic-messages` |
| OpenAI API | `https://api.minimax.io/v1` | `openai-completions` or `openai-responses` |
Pick whichever protocol your tooling supports. For Prime Agent's Anthropic-compatible model, use the Anthropic endpoint.
## The Fix
Edit `~/.prime/agent/models.json`:
```json
{
"providers": {
"minimax": {
"name": "MiniMax",
"baseUrl": "https://api.minimax.io/anthropic",
"apiKey": "your-subscription-key-here",
"api": "anthropic-messages",
"authHeader": true,
"models": [
{
"id": "MiniMax-M3",
"name": "MiniMax-M3",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 1000000,
"maxTokens": 32000,
"compat": {}
}
]
}
}
}
```
Key points:
- `api` is `"anthropic-messages"`, not `"anthropic"`. Prime Agent only recognizes the full name.
- `baseUrl` includes the `/anthropic` path. Without it, requests hit the wrong endpoint and return 404.
- The provider key (`minimax`) is what you'll reference in `settings.json` and when switching models.
Then update `~/.prime/agent/settings.json` to use it:
```json
{
"defaultProvider": "minimax",
"defaultModel": "MiniMax-M3"
}
```
Run `/reload` in Prime Agent and you should be good to go.
## Step-by-Step
1. Get a subscription key from the [MiniMax Token Plan](https://platform.minimax.io) page.
2. Create or edit `~/.prime/agent/models.json` with the configuration above.
3. Make sure `settings.json` references the same provider name (`minimax`).
4. Run `/reload` in Prime Agent.
5. Switch to the model with `minimax/MiniMax-M3`.
## Verifying the API Works
Before assuming the issue is on Prime Agent's side, test MiniMax directly:
```bash
curl -X POST https://api.minimax.io/anthropic/v1/messages \
-H "x-api-key: $MINIMAX_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "MiniMax-M3",
"max_tokens": 100,
"messages": [{"role": "user", "content": "Hello"}]
}'
```
A successful response looks like:
```json
{
"id": "...",
"type": "message",
"role": "assistant",
"model": "MiniMax-M3",
"content": [{"text": "Hello!", "type": "text"}],
...
}
```
If this returns 200, MiniMax is reachable and your API key is valid. Any Prime Agent errors after that are configuration issues.
## Troubleshooting
| Error | Cause | Fix |
|-------|-------|-----|
| `No API provider registered for api: anthropic` | `api` field is set to `"anthropic"` | Change to `"anthropic-messages"` |
| `Model not found: minimax/MiniMax-M3` | Provider name in `models.json` doesn't match `settings.json` | Make sure both use `minimax` (or whatever name you pick) |
| 404 from `https://api.minimax.io/v1/messages` | `baseUrl` is missing the `/anthropic` path | Use `https://api.minimax.io/anthropic` for the Anthropic protocol |
| `401 Unauthorized` | Wrong or expired API key | Get a new subscription key from the Token Plan page |
## Why These Specific Values?
Prime Agent's [extensions documentation](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/docs/extensions.md) shows three valid `api` values for `registerProvider()`: `openai-completions`, `openai-responses`, and `anthropic-messages`. The shorter `anthropic` value is what the official Anthropic SDK uses, but Prime Agent requires the full name.
The `baseUrl` quirk is documented in MiniMax's [Other Tools guide](https://platform.minimax.io/docs/token-plan/other-tools): the Anthropic-compatible protocol lives at `/anthropic`, while OpenAI-compatible lives at `/v1`. Using the bare hostname (`https://api.minimax.io`) doesn't route to either.
## References
- [Prime Agent — Extensions documentation](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/docs/extensions.md)
- [MiniMax — Anthropic API reference](https://platform.minimax.io/docs/api-reference/text-anthropic-api)
- [MiniMax — OpenAI API reference](https://platform.minimax.io/docs/api-reference/text-openai-api)
- [MiniMax — Other Tools configuration](https://platform.minimax.io/docs/token-plan/other-tools)
- [MiniMax — Token Plan](https://platform.minimax.io)
Comments
Post a Comment