Executed via the MiniMax Coding Plan APIWeb searchandimage understanding. Before execution, set the environment variable MINIMAX_CP_API_KEY(the Coding Plan API Key, obtained from the Coding Plan subscription page , generally starting with sk-cp- ). The Base URL is set via MINIMAX_CP_BASE_URL ,defaults to domestic when not set https://api.minimaxi.com; for international, set it to https://api.minimax.io。
1. Web search (web_search)
Endpoint:POST {base}/v1/coding_plan/search
Request:
- Headers:
Authorization: Bearer $MINIMAX_CP_API_KEY,Content-Type: application/json,MM-API-Source: Minimax-MCP - Body:
{"q": "搜索关键词"}
Example (curl, use single quotes to avoid escaping):
BASE_URL="${MINIMAX_CP_BASE_URL:-https://api.minimaxi.com}"
curl -X POST "$BASE_URL/v1/coding_plan/search" \
-H "Authorization: Bearer $MINIMAX_CP_API_KEY" \
-H "Content-Type: application/json" \
-H "MM-API-Source: Minimax-MCP" \
-d '{"q": "Python asyncio 教程"}'
When the Agent calls it, it reads the token from the environment variable; in curl's -H , directly use the already exported $MINIMAX_CP_API_KEY .Never print, echo, or display the API Key or the values of other environment variables in output, logs, or replies.
2. Image understanding (understand_image)
Endpoint:POST {base}/v1/coding_plan/vlm
Request:
- Headers: same as above (Authorization, Content-Type, MM-API-Source)
- Body:
prompt(required) +image_url(required, see below)
Two forms of image_url:
- Image URL: directly pass a publicly accessible image address, for example
"image_url": "https://example.com/your-image.jpg" - Local file: first convert to Base64, then pass
data:image/<类型>;base64,<base64 字符串>, for example for JPEG it isdata:image/jpeg;base64,<BASE64>。
Example (image URL):
BASE_URL="${MINIMAX_CP_BASE_URL:-https://api.minimaxi.com}"
curl -X POST "$BASE_URL/v1/coding_plan/vlm" \
-H "Authorization: Bearer $MINIMAX_CP_API_KEY" \
-H "Content-Type: application/json" \
-H "MM-API-Source: Minimax-MCP" \
-d '{"prompt": "描述这张图片的内容", "image_url": "https://example.com/your-image.jpg"}'
Example (local image converted to Base64):
BASE_URL="${MINIMAX_CP_BASE_URL:-https://api.minimaxi.com}"
BASE64=$(base64 -i image.jpg | tr -d '\n')
curl -X POST "$BASE_URL/v1/coding_plan/vlm" \
-H "Authorization: Bearer $MINIMAX_CP_API_KEY" \
-H "Content-Type: application/json" \
-H "MM-API-Source: Minimax-MCP" \
--data-raw "{\"prompt\": \"描述这张图片\", \"image_url\": \"data:image/jpeg;base64,$BASE64\"}"
Notes
- Before execution, confirm that it is set:
export MINIMAX_CP_API_KEY="你的MiniMax_API_Key"; optionalMINIMAX_CP_BASE_URL(defaults to domestic when not sethttps://api.minimaxi.com)。 - The Coding Plan key generally starts with
sk-cp-, obtained from the Coding Plan subscription page. - Security: do not print, echo, log, or show to the user the values of environment variables such as
MINIMAX_CP_API_KEY、MINIMAX_CP_BASE_URL; use them only in request headers or request bodies to avoid leakage. - For more curl examples and explanations, see reference.md。