Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ When writing tests that require calling AI models, the following secrets are ava
- `OPENAI_API_KEY` - API key for OpenAI GPT Models
- `ZAI_API_KEY` - API key for Z.AI GLM Models
- `MOONSHOT_API_KEY` - API key for MoonShot Kimi Models
- `MINIMAX_API_KEY` - API key or Token Plan Subscription Key for MiniMax Models
- `DEEPSEEK_API_KEY` - API key for DeepSeek Models
- `MODELVERSE_API_KEY` - API key for ModelVerse Models
- `OPENROUTER_API_KEY` - API key for OpenRouter Models
Expand All @@ -96,6 +97,7 @@ env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }}
MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }}
MINIMAX_API_KEY: ${{ secrets.MINIMAX_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
MODELVERSE_API_KEY: ${{ secrets.MODELVERSE_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }}
MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }}
MINIMAX_API_KEY: ${{ secrets.MINIMAX_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
MODELVERSE_API_KEY: ${{ secrets.MODELVERSE_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }}
MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }}
MINIMAX_API_KEY: ${{ secrets.MINIMAX_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
MODELVERSE_API_KEY: ${{ secrets.MODELVERSE_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
Expand Down
34 changes: 34 additions & 0 deletions changelog/0.4.2/2026-08-03-minimax-m3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# MiniMax M3 support

AgentHub now supports the official MiniMax `MiniMax-M3` Responses API at `https://api.minimax.io/v1`. The `minimax-m3` client accepts either a MiniMax Token Plan Subscription Key or a pay-as-you-go API key through `MINIMAX_API_KEY`; `MINIMAX_BASE_URL` overrides the default endpoint.

## Protocol implementation

- Added paired Python and TypeScript MiniMax Responses clients, exact `MiniMax-M3` routing, a supported-model registry entry, env-gated E2E registration, and CI secret forwarding.
- A two-round live capture verified reasoning, function calls, replayed function outputs, and a final answer. The first response produced two independent tool calls.
- The observed stream sequence is `response.created`, `response.in_progress`, reasoning item/content events, then `response.output_item.added`, argument deltas, `response.function_call_arguments.done`, and `response.output_item.done` for each function call before `response.completed`. The raw `arguments.done` event omitted the function name, so AgentHub finalizes calls from the authoritative completed output item.
- Fidelity is recorded only when the universal fields cannot represent information needed by the client: partial tool-call events retain `item_id` and `output_index` so interleaved parallel deltas remain correlatable, text items retain their output-item ID as `phase`, completed reasoning items retain their JSON wire item for replay, and completed function calls retain only their raw argument string so JSON numeric precision and formatting survive replay. Completed messages and the remaining function-call fields are rebuilt from their universal fields without duplicating the full wire item in fidelity.
- `response.completed` reports `tool_call` when its output contains a function call. `response.incomplete` maps `max_output_tokens` to `length` and `content_filter` to `stop`; failed and error events surface the provider's details.
- Captured reasoning uses `response.reasoning_text.delta` rather than OpenAI's reasoning-summary event. MiniMax does not use OpenAI's encrypted reasoning content, so AgentHub does not request it.
- Completed-response usage maps `input_tokens_details.cached_tokens` to `cached_tokens`, and `output_tokens_details.reasoning_tokens` to `thoughts_tokens`.

## Configuration behavior

| AgentHub configuration | MiniMax request behavior |
| --- | --- |
| `system_prompt` | `instructions` |
| `max_tokens` | `max_output_tokens` |
| `temperature` | Passed through for the documented range 0–1; other values raise `UnsupportedParameterError`. |
| `ThinkingLevel.NONE` | `reasoning.effort = "none"`. |
| `ThinkingLevel.LOW` / `MEDIUM` / `HIGH` | `reasoning.effort` `low` / `medium` / `high`. |
| `ThinkingLevel.XHIGH` | Gracefully degrades to `high`. |
| `thinking_summary` | Omitted because MiniMax documents no matching request field. |
| `PromptCaching.ENABLE` | Omitted; MiniMax caching is automatic. |
| `PromptCaching.DISABLE` | Raises `UnsupportedParameterError`; MiniMax documents no cache-disable setting. |
| `PromptCaching.ENHANCE` | Raises `UnsupportedParameterError`; MiniMax documents no configurable cache-retention setting. |
| `tool_choice` `auto` / `none` | Passed through. |
| `tool_choice` `required` or named-tool list | Raises `UnsupportedParameterError`; MiniMax does not document those modes. |

## Registry metadata

`MiniMax-M3` is registered with text and image input, text output, and a 1,000,000-token context window. Pricing is omitted because MiniMax doubles cache-read, input, and output rates above 512K input tokens, while the registry cannot express tiered pricing.
1 change: 1 addition & 0 deletions changelog/0.4.2/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 0.4.2 (unreleased)

- [2026-08-03] Official MiniMax M3 direct Responses API and Token Plan Subscription Key support. ([details](2026-08-03-minimax-m3.md))
- [2026-07-24] Gemini 3 clients clamp thinking levels to what each model actually supports — fixes `gemini-3.1-pro` rejecting `ThinkingLevel.NONE` with "Thinking level MINIMAL is not supported". ([details](2026-07-24-gemini-thinking-level-clamp.md))
1 change: 1 addition & 0 deletions llmsdk_docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ To use a specific model, please refer to its dedicated README:
- **[GLM-5.2](./glm5_2/README.md)** - Z.AI's GLM-5.2 API documentation (reasoning_effort, thinking modes, tool streaming)
- **[GPT-5.5](./gpt5_5/README.md)** - OpenAI's GPT-5.5 API documentation and examples
- **[Kimi K3](./kimi_k3/README.md)** - Moonshot's Kimi K3 API documentation (reasoning_effort, tool calling, vision, caching)
- **[MiniMax M-series](./minimax_m3/README.md)** - Responses API-compatible documentation for MiniMax M3 and M2.7, plus Token Plan Subscription Key integration

Each model directory contains:
- `docs/` - Detailed documentation for the model's features and capabilities
Expand Down
44 changes: 44 additions & 0 deletions llmsdk_docs/minimax_m3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# MiniMax M3 SDK Documentation

This directory contains the official-documentation snapshot used to implement MiniMax M3 Responses API support and Token Plan authentication.

## Quick Start

- **Python users**: See [quickstart.python.md](./quickstart.python.md)
- **TypeScript users**: See [quickstart.typescript.md](./quickstart.typescript.md)

## Documentation

The `docs/` directory contains the official MiniMax documentation used for this protocol:

- [api-overview.md](./docs/api-overview.md) - API-key and Subscription Key overview, model list, and supported SDK surfaces
- [models-intro.md](./docs/models-intro.md) - Current language and multimodal model catalog
- [list-models.md](./docs/list-models.md) - `GET /v1/models` schema and model IDs
- [responses-create.md](./docs/responses-create.md) - `POST /v1/responses` request and response schemas, reasoning, tool calls, history replay, input modalities, and usage
- [errorcode.md](./docs/errorcode.md) - Common authentication, rate-limit, quota, content, and server error codes
- [text-openai-api.md](./docs/text-openai-api.md) - OpenAI-compatible model coverage and M3/M2.x behavior
- [text-anthropic-api.md](./docs/text-anthropic-api.md) - Anthropic-compatible model coverage, content modalities, tools, and thinking behavior
- [tool-use-interleaved-thinking.md](./docs/tool-use-interleaved-thinking.md) - Tool use and the requirement to preserve complete reasoning-bearing assistant history
- [prompt-caching.md](./docs/prompt-caching.md) - Passive caching behavior, cache-hit usage, and pricing semantics
- [pricing-token-plan.md](./docs/pricing-token-plan.md) - Token Plan pricing and quota coverage
- [pricing-paygo.md](./docs/pricing-paygo.md) - Current and legacy pay-as-you-go model pricing
- [token-plan-overview.md](./docs/token-plan-overview.md) - Subscription Key lifecycle, quota windows, and API-key distinction
- [index.md](./docs/index.md) - MiniMax's official documentation index and API-spec links

The official Responses page documents SSE support but not the exact event sequence. AgentHub verifies event ordering with two-round live captures under the git-ignored `api_captures/minimax_m3/` directory and records the observed protocol details in the release changelog.

## Official sources

- https://platform.minimax.io/docs/api-reference/responses-create
- https://platform.minimax.io/docs/api-reference/models/openai/list-models
- https://platform.minimax.io/docs/api-reference/text-openai-api
- https://platform.minimax.io/docs/api-reference/text-anthropic-api
- https://platform.minimax.io/docs/guides/models-intro
- https://platform.minimax.io/docs/guides/pricing-paygo
- https://platform.minimax.io/docs/guides/text-m3-function-call
- https://platform.minimax.io/docs/token-plan/intro
- https://platform.minimax.io/docs/api-reference/api-overview
- https://platform.minimax.io/docs/api-reference/errorcode.md
- https://platform.minimax.io/docs/api-reference/text-prompt-caching.md
- https://platform.minimax.io/docs/guides/pricing-token-plan.md
- https://platform.minimax.io/docs/llms.txt
Loading
Loading