{"owner":"OpenBMB","repo":"MiniCPM-V","hasSkills":true,"totalSkillsCount":1,"totalTokensCount":2457,"categories":["project-spec"],"hasMcp":false,"mcpConfig":null,"found":["docs/api.md"],"skills":{"docs/api.md":"# API Guide\n\nThis document introduces how to use the Chat Completions APIs for MiniCPM-V 4.5 / 4.6 / 4.7 and MiniCPM-o 4.5, including text, image, and video understanding.\n\n## Endpoint\n\n```text\nBase URL: https://api.modelbest.cn/v1\nChat API: POST /chat/completions\nAuthorization: Bearer <API_KEY>\nContent-Type: application/json\n```\n\nThe API is OpenAI-compatible. Create an API key at [platform.modelbest.cn](https://platform.modelbest.cn), then:\n\n```bash\nexport API_KEY=\"your-api-key\"\n```\n\n## Available Models\n\n```text\nMiniCPM-V-4.7-1B\nMiniCPM-V-4.7-35B-A3B\nMiniCPM-V-4.5-9B\nMiniCPM-V-4.6-1B\nMiniCPM-V-4.6-Thinking\nMiniCPM-O-4.5-9B\n```\n\n## MiniCPM-V 4.7\n\nMiniCPM-V 4.7 comes in two sizes — `MiniCPM-V-4.7-1B` (dense, edge-friendly) and `MiniCPM-V-4.7-35B-A3B` (MoE, high-throughput). Both support text-only, image, and video understanding through the Chat Completions API. Pick the size by setting the `model` field.\n\nThinking is **off by default**; enable it per request with `chat_template_kwargs` (see below). The reasoning trace is returned in `message.reasoning`.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\nFor the MoE size, replace the `model` value with `\"MiniCPM-V-4.7-35B-A3B\"`.\n\nTo enable thinking, add:\n\n```json\n\"chat_template_kwargs\": {\"enable_thinking\": true}\n```\n\nThe thinking model returns its intermediate reasoning in `message.reasoning` and the final answer in `message.content`.\n\n### Image Understanding\n\nImages are passed as base64 data URLs in the `image_url` content format.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\nVideos are passed as base64 data URLs in the `video_url` content format (for example `data:video/mp4;base64,...`).\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n## MiniCPM-V 4.6\n\nMiniCPM-V 4.6 can be called through the Chat Completions API. The interface supports text-only, image, and video understanding requests.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\nTo use the Thinking model, replace the `model` value with:\n\n```json\n\"MiniCPM-V-4.6-Thinking\"\n```\n\nThe Thinking model may return intermediate reasoning in `message.reasoning`.\n\n### Image Understanding\n\nImages are passed as base64 data URLs in the `image_url` content format.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\nVideos are passed as base64 data URLs in the `video_url` content format (for example `data:video/mp4;base64,...`). The same format works for `MiniCPM-V-4.7-1B`, `MiniCPM-V-4.7-35B-A3B`, `MiniCPM-V-4.5-9B`, `MiniCPM-V-4.6-1B`, `MiniCPM-V-4.6-Thinking`, and `MiniCPM-O-4.5-9B`.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Python Example\n\n```python\nimport json\nimport os\nimport urllib.request\n\napi_key = os.environ[\"API_KEY\"]\npayload = {\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n        {\n            \"role\": \"user\",\n            \"content\": \"List three use cases for MiniCPM-V.\",\n        }\n    ],\n}\n\nrequest = urllib.request.Request(\n    \"https://api.modelbest.cn/v1/chat/completions\",\n    data=json.dumps(payload).encode(\"utf-8\"),\n    headers={\n        \"Authorization\": f\"Bearer {api_key}\",\n        \"Content-Type\": \"application/json\",\n    },\n    method=\"POST\",\n)\n\nwith urllib.request.urlopen(request) as response:\n    data = json.loads(response.read().decode(\"utf-8\"))\n\nprint(data[\"choices\"][0][\"message\"][\"content\"])\n```\n\nOr with the OpenAI SDK:\n\n```python\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"API_KEY\"],\n    base_url=\"https://api.modelbest.cn/v1\",\n)\n\nresp = client.chat.completions.create(\n    model=\"MiniCPM-V-4.6-1B\",\n    messages=[{\"role\": \"user\", \"content\": \"List three use cases for MiniCPM-V.\"}],\n)\nprint(resp.choices[0].message.content)\n```\n\n## MiniCPM-V 4.5\n\nSame Chat Completions API as above (text / image / video). Use model ID `MiniCPM-V-4.5-9B`:\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\n## MiniCPM-o 4.5\n\nMiniCPM-o 4.5 can be called through the Chat Completions API for text, image, and video understanding requests, and also full-duplex realtime interaction.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\n### Image Understanding\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Realtime API\n\nMiniCPM-o 4.5 also supports full-duplex realtime multimodal interaction. For the Realtime API documentation, see the [Realtime API Overview](https://minicpmo45.modelbest.cn/docs/en/realtime-api/overview/).\n"},"files":{"docs/api.md":"# API Guide\n\nThis document introduces how to use the Chat Completions APIs for MiniCPM-V 4.5 / 4.6 / 4.7 and MiniCPM-o 4.5, including text, image, and video understanding.\n\n## Endpoint\n\n```text\nBase URL: https://api.modelbest.cn/v1\nChat API: POST /chat/completions\nAuthorization: Bearer <API_KEY>\nContent-Type: application/json\n```\n\nThe API is OpenAI-compatible. Create an API key at [platform.modelbest.cn](https://platform.modelbest.cn), then:\n\n```bash\nexport API_KEY=\"your-api-key\"\n```\n\n## Available Models\n\n```text\nMiniCPM-V-4.7-1B\nMiniCPM-V-4.7-35B-A3B\nMiniCPM-V-4.5-9B\nMiniCPM-V-4.6-1B\nMiniCPM-V-4.6-Thinking\nMiniCPM-O-4.5-9B\n```\n\n## MiniCPM-V 4.7\n\nMiniCPM-V 4.7 comes in two sizes — `MiniCPM-V-4.7-1B` (dense, edge-friendly) and `MiniCPM-V-4.7-35B-A3B` (MoE, high-throughput). Both support text-only, image, and video understanding through the Chat Completions API. Pick the size by setting the `model` field.\n\nThinking is **off by default**; enable it per request with `chat_template_kwargs` (see below). The reasoning trace is returned in `message.reasoning`.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\nFor the MoE size, replace the `model` value with `\"MiniCPM-V-4.7-35B-A3B\"`.\n\nTo enable thinking, add:\n\n```json\n\"chat_template_kwargs\": {\"enable_thinking\": true}\n```\n\nThe thinking model returns its intermediate reasoning in `message.reasoning` and the final answer in `message.content`.\n\n### Image Understanding\n\nImages are passed as base64 data URLs in the `image_url` content format.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\nVideos are passed as base64 data URLs in the `video_url` content format (for example `data:video/mp4;base64,...`).\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n## MiniCPM-V 4.6\n\nMiniCPM-V 4.6 can be called through the Chat Completions API. The interface supports text-only, image, and video understanding requests.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\nTo use the Thinking model, replace the `model` value with:\n\n```json\n\"MiniCPM-V-4.6-Thinking\"\n```\n\nThe Thinking model may return intermediate reasoning in `message.reasoning`.\n\n### Image Understanding\n\nImages are passed as base64 data URLs in the `image_url` content format.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\nVideos are passed as base64 data URLs in the `video_url` content format (for example `data:video/mp4;base64,...`). The same format works for `MiniCPM-V-4.7-1B`, `MiniCPM-V-4.7-35B-A3B`, `MiniCPM-V-4.5-9B`, `MiniCPM-V-4.6-1B`, `MiniCPM-V-4.6-Thinking`, and `MiniCPM-O-4.5-9B`.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Python Example\n\n```python\nimport json\nimport os\nimport urllib.request\n\napi_key = os.environ[\"API_KEY\"]\npayload = {\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n        {\n            \"role\": \"user\",\n            \"content\": \"List three use cases for MiniCPM-V.\",\n        }\n    ],\n}\n\nrequest = urllib.request.Request(\n    \"https://api.modelbest.cn/v1/chat/completions\",\n    data=json.dumps(payload).encode(\"utf-8\"),\n    headers={\n        \"Authorization\": f\"Bearer {api_key}\",\n        \"Content-Type\": \"application/json\",\n    },\n    method=\"POST\",\n)\n\nwith urllib.request.urlopen(request) as response:\n    data = json.loads(response.read().decode(\"utf-8\"))\n\nprint(data[\"choices\"][0][\"message\"][\"content\"])\n```\n\nOr with the OpenAI SDK:\n\n```python\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"API_KEY\"],\n    base_url=\"https://api.modelbest.cn/v1\",\n)\n\nresp = client.chat.completions.create(\n    model=\"MiniCPM-V-4.6-1B\",\n    messages=[{\"role\": \"user\", \"content\": \"List three use cases for MiniCPM-V.\"}],\n)\nprint(resp.choices[0].message.content)\n```\n\n## MiniCPM-V 4.5\n\nSame Chat Completions API as above (text / image / video). Use model ID `MiniCPM-V-4.5-9B`:\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\n## MiniCPM-o 4.5\n\nMiniCPM-o 4.5 can be called through the Chat Completions API for text, image, and video understanding requests, and also full-duplex realtime interaction.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\n### Image Understanding\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Realtime API\n\nMiniCPM-o 4.5 also supports full-duplex realtime multimodal interaction. For the Realtime API documentation, see the [Realtime API Overview](https://minicpmo45.modelbest.cn/docs/en/realtime-api/overview/).\n"},"items":[{"name":"api.md","path":"docs/api.md","rawUrl":"https://raw.githubusercontent.com/OpenBMB/MiniCPM-V/HEAD/docs/api.md","title":"docs - API Interface Contract & Specifications","category":"project-spec","format":"markdown","content":"# API Guide\n\nThis document introduces how to use the Chat Completions APIs for MiniCPM-V 4.5 / 4.6 / 4.7 and MiniCPM-o 4.5, including text, image, and video understanding.\n\n## Endpoint\n\n```text\nBase URL: https://api.modelbest.cn/v1\nChat API: POST /chat/completions\nAuthorization: Bearer <API_KEY>\nContent-Type: application/json\n```\n\nThe API is OpenAI-compatible. Create an API key at [platform.modelbest.cn](https://platform.modelbest.cn), then:\n\n```bash\nexport API_KEY=\"your-api-key\"\n```\n\n## Available Models\n\n```text\nMiniCPM-V-4.7-1B\nMiniCPM-V-4.7-35B-A3B\nMiniCPM-V-4.5-9B\nMiniCPM-V-4.6-1B\nMiniCPM-V-4.6-Thinking\nMiniCPM-O-4.5-9B\n```\n\n## MiniCPM-V 4.7\n\nMiniCPM-V 4.7 comes in two sizes — `MiniCPM-V-4.7-1B` (dense, edge-friendly) and `MiniCPM-V-4.7-35B-A3B` (MoE, high-throughput). Both support text-only, image, and video understanding through the Chat Completions API. Pick the size by setting the `model` field.\n\nThinking is **off by default**; enable it per request with `chat_template_kwargs` (see below). The reasoning trace is returned in `message.reasoning`.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\nFor the MoE size, replace the `model` value with `\"MiniCPM-V-4.7-35B-A3B\"`.\n\nTo enable thinking, add:\n\n```json\n\"chat_template_kwargs\": {\"enable_thinking\": true}\n```\n\nThe thinking model returns its intermediate reasoning in `message.reasoning` and the final answer in `message.content`.\n\n### Image Understanding\n\nImages are passed as base64 data URLs in the `image_url` content format.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\nVideos are passed as base64 data URLs in the `video_url` content format (for example `data:video/mp4;base64,...`).\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n## MiniCPM-V 4.6\n\nMiniCPM-V 4.6 can be called through the Chat Completions API. The interface supports text-only, image, and video understanding requests.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\nTo use the Thinking model, replace the `model` value with:\n\n```json\n\"MiniCPM-V-4.6-Thinking\"\n```\n\nThe Thinking model may return intermediate reasoning in `message.reasoning`.\n\n### Image Understanding\n\nImages are passed as base64 data URLs in the `image_url` content format.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\nVideos are passed as base64 data URLs in the `video_url` content format (for example `data:video/mp4;base64,...`). The same format works for `MiniCPM-V-4.7-1B`, `MiniCPM-V-4.7-35B-A3B`, `MiniCPM-V-4.5-9B`, `MiniCPM-V-4.6-1B`, `MiniCPM-V-4.6-Thinking`, and `MiniCPM-O-4.5-9B`.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Python Example\n\n```python\nimport json\nimport os\nimport urllib.request\n\napi_key = os.environ[\"API_KEY\"]\npayload = {\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n        {\n            \"role\": \"user\",\n            \"content\": \"List three use cases for MiniCPM-V.\",\n        }\n    ],\n}\n\nrequest = urllib.request.Request(\n    \"https://api.modelbest.cn/v1/chat/completions\",\n    data=json.dumps(payload).encode(\"utf-8\"),\n    headers={\n        \"Authorization\": f\"Bearer {api_key}\",\n        \"Content-Type\": \"application/json\",\n    },\n    method=\"POST\",\n)\n\nwith urllib.request.urlopen(request) as response:\n    data = json.loads(response.read().decode(\"utf-8\"))\n\nprint(data[\"choices\"][0][\"message\"][\"content\"])\n```\n\nOr with the OpenAI SDK:\n\n```python\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"API_KEY\"],\n    base_url=\"https://api.modelbest.cn/v1\",\n)\n\nresp = client.chat.completions.create(\n    model=\"MiniCPM-V-4.6-1B\",\n    messages=[{\"role\": \"user\", \"content\": \"List three use cases for MiniCPM-V.\"}],\n)\nprint(resp.choices[0].message.content)\n```\n\n## MiniCPM-V 4.5\n\nSame Chat Completions API as above (text / image / video). Use model ID `MiniCPM-V-4.5-9B`:\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\n## MiniCPM-o 4.5\n\nMiniCPM-o 4.5 can be called through the Chat Completions API for text, image, and video understanding requests, and also full-duplex realtime interaction.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\n### Image Understanding\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Realtime API\n\nMiniCPM-o 4.5 also supports full-duplex realtime multimodal interaction. For the Realtime API documentation, see the [Realtime API Overview](https://minicpmo45.modelbest.cn/docs/en/realtime-api/overview/).\n","isInternal":false,"tokens":2457,"sizeBytes":8555}],"systemPromptSnippet":"<yakaai_skills repo=\"OpenBMB/MiniCPM-V\">\n<!-- File: docs/api.md (Tokens: ~2457 | Category: project-spec) -->\n# API Guide\n\nThis document introduces how to use the Chat Completions APIs for MiniCPM-V 4.5 / 4.6 / 4.7 and MiniCPM-o 4.5, including text, image, and video understanding.\n\n## Endpoint\n\n```text\nBase URL: https://api.modelbest.cn/v1\nChat API: POST /chat/completions\nAuthorization: Bearer <API_KEY>\nContent-Type: application/json\n```\n\nThe API is OpenAI-compatible. Create an API key at [platform.modelbest.cn](https://platform.modelbest.cn), then:\n\n```bash\nexport API_KEY=\"your-api-key\"\n```\n\n## Available Models\n\n```text\nMiniCPM-V-4.7-1B\nMiniCPM-V-4.7-35B-A3B\nMiniCPM-V-4.5-9B\nMiniCPM-V-4.6-1B\nMiniCPM-V-4.6-Thinking\nMiniCPM-O-4.5-9B\n```\n\n## MiniCPM-V 4.7\n\nMiniCPM-V 4.7 comes in two sizes — `MiniCPM-V-4.7-1B` (dense, edge-friendly) and `MiniCPM-V-4.7-35B-A3B` (MoE, high-throughput). Both support text-only, image, and video understanding through the Chat Completions API. Pick the size by setting the `model` field.\n\nThinking is **off by default**; enable it per request with `chat_template_kwargs` (see below). The reasoning trace is returned in `message.reasoning`.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\nFor the MoE size, replace the `model` value with `\"MiniCPM-V-4.7-35B-A3B\"`.\n\nTo enable thinking, add:\n\n```json\n\"chat_template_kwargs\": {\"enable_thinking\": true}\n```\n\nThe thinking model returns its intermediate reasoning in `message.reasoning` and the final answer in `message.content`.\n\n### Image Understanding\n\nImages are passed as base64 data URLs in the `image_url` content format.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\nVideos are passed as base64 data URLs in the `video_url` content format (for example `data:video/mp4;base64,...`).\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.7-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n## MiniCPM-V 4.6\n\nMiniCPM-V 4.6 can be called through the Chat Completions API. The interface supports text-only, image, and video understanding requests.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\nTo use the Thinking model, replace the `model` value with:\n\n```json\n\"MiniCPM-V-4.6-Thinking\"\n```\n\nThe Thinking model may return intermediate reasoning in `message.reasoning`.\n\n### Image Understanding\n\nImages are passed as base64 data URLs in the `image_url` content format.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\nVideos are passed as base64 data URLs in the `video_url` content format (for example `data:video/mp4;base64,...`). The same format works for `MiniCPM-V-4.7-1B`, `MiniCPM-V-4.7-35B-A3B`, `MiniCPM-V-4.5-9B`, `MiniCPM-V-4.6-1B`, `MiniCPM-V-4.6-Thinking`, and `MiniCPM-O-4.5-9B`.\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Python Example\n\n```python\nimport json\nimport os\nimport urllib.request\n\napi_key = os.environ[\"API_KEY\"]\npayload = {\n    \"model\": \"MiniCPM-V-4.6-1B\",\n    \"messages\": [\n        {\n            \"role\": \"user\",\n            \"content\": \"List three use cases for MiniCPM-V.\",\n        }\n    ],\n}\n\nrequest = urllib.request.Request(\n    \"https://api.modelbest.cn/v1/chat/completions\",\n    data=json.dumps(payload).encode(\"utf-8\"),\n    headers={\n        \"Authorization\": f\"Bearer {api_key}\",\n        \"Content-Type\": \"application/json\",\n    },\n    method=\"POST\",\n)\n\nwith urllib.request.urlopen(request) as response:\n    data = json.loads(response.read().decode(\"utf-8\"))\n\nprint(data[\"choices\"][0][\"message\"][\"content\"])\n```\n\nOr with the OpenAI SDK:\n\n```python\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"API_KEY\"],\n    base_url=\"https://api.modelbest.cn/v1\",\n)\n\nresp = client.chat.completions.create(\n    model=\"MiniCPM-V-4.6-1B\",\n    messages=[{\"role\": \"user\", \"content\": \"List three use cases for MiniCPM-V.\"}],\n)\nprint(resp.choices[0].message.content)\n```\n\n## MiniCPM-V 4.5\n\nSame Chat Completions API as above (text / image / video). Use model ID `MiniCPM-V-4.5-9B`:\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-V-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\n## MiniCPM-o 4.5\n\nMiniCPM-o 4.5 can be called through the Chat Completions API for text, image, and video understanding requests, and also full-duplex realtime interaction.\n\n### Text-Only Request\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Introduce yourself in one sentence.\"\n      }\n    ]\n  }'\n```\n\n### Image Understanding\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this image.\"\n          },\n          {\n            \"type\": \"image_url\",\n            \"image_url\": {\n              \"url\": \"data:image/png;base64,<BASE64_IMAGE>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Video Understanding\n\n```bash\ncurl https://api.modelbest.cn/v1/chat/completions \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"MiniCPM-O-4.5-9B\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\n            \"type\": \"text\",\n            \"text\": \"Describe this video briefly.\"\n          },\n          {\n            \"type\": \"video_url\",\n            \"video_url\": {\n              \"url\": \"data:video/mp4;base64,<BASE64_VIDEO>\"\n            }\n          }\n        ]\n      }\n    ]\n  }'\n```\n\n### Realtime API\n\nMiniCPM-o 4.5 also supports full-duplex realtime multimodal interaction. For the Realtime API documentation, see the [Realtime API Overview](https://minicpmo45.modelbest.cn/docs/en/realtime-api/overview/).\n</yakaai_skills>"}