Using MiniMax M3.1 Flash on Vercel AI Gateway

Implementation guide · MiniMax M3 · MiniMax

Serverless

Vercel AI Gateway exposes MiniMax M3.1 Flash through model ID minimax/minimax-m3.1-flash. Use the setup steps, sourced pricing, capabilities, and official provider links below to validate this route before deployment.

Last refreshed 2026-10-19. Next refresh: weekly.

Quick Start

  1. 1
    Create an account at Vercel AI Gateway and generate an API key.
  2. 2
    Use the Vercel AI Gateway SDK or REST API to call minimax/minimax-m3.1-flash — see the documentation for request format.
  3. 3
    You'll be billed Free/1M input, Free/1M output tokens. See full pricing.

Code Examples

Install
pip install openai
API key
AI_GATEWAY_API_KEY
Model ID
minimax/minimax-m3.1-flash

creator/model-name e.g. kwaipilot/kat-coder-pro-v2

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
    base_url="https://ai-gateway.vercel.sh/v1"
)
response = client.chat.completions.create(
    model="minimax/minimax-m3.1-flash",
    messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)

Pricing on Vercel AI Gateway

TypePrice (per 1M)
Input tokensFree
Output tokensFree

Capabilities

VisionMultimodalReasoningJSON / Tool useStructured OutputsPrompt Caching

About MiniMax M3.1 Flash

MiniMax M3.1 Flash (API ID MiniMax-M3.1-Flash) is MiniMax's M-series language model for agentic reasoning, tool use, coding, computer use, cybersecurity and long-context tasks. It has a 1,000,000-token context window, accepts text, image and video input, and always thinks before answering, with tunable thinking depth (effort: low, medium, high, xhigh, max; default max). Flat pay-as-you-go pricing is $0.15 / $0.60 / $0.015 per 1M input / output / cached-input tokens. It replaces MiniMax M3.1 Flash Preview. Model weights are promised later and are not on Hugging Face as of 2026-10-19.

Model Specs

Released2026-10-19
Context1M
ArchitectureDecoder Only

Provider

Vercel AI Gateway

Vercel