Integrations

OpenRouter

OpenRouter provides a unified API for routing requests across model providers. If you use OpenRouter instead of the MARA Cloud API, MiniMax M2.7 is available with the OpenRouter model ID minimax/minimax-m2.7.

Model IDs

PlatformModel ID
MARA CloudMiniMax-M2.7
OpenRouterminimax/minimax-m2.7

Python

Use the OpenAI SDK with OpenRouter's base URL:
python
from openai import OpenAI

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="your-openrouter-api-key",
)

completion = client.chat.completions.create(
    model="minimax/minimax-m2.7",
    messages=[
        {"role": "user", "content": "Summarize the benefits of long-context models."}
    ],
)

print(completion.choices[0].message.content)

JavaScript

javascript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://openrouter.ai/api/v1",
  apiKey: "your-openrouter-api-key",
});

const completion = await client.chat.completions.create({
  model: "minimax/minimax-m2.7",
  messages: [
    { role: "user", content: "Summarize the benefits of long-context models." },
  ],
});

console.log(completion.choices[0].message.content);

Learn more