Features

OpenAI Compatibility

MARA Cloud inference APIs are designed to be fully compatible with OpenAI client libraries, making it easy to integrate MARA Cloud into your existing applications. If you already use the OpenAI Python or JavaScript SDK, all you need to change is the base URL and API key.

Setup

Install the OpenAI client library:
bash
pip install openai

Client configuration

Initialize the OpenAI client with your MARA Cloud credentials:
python
from openai import OpenAI

client = OpenAI(
    base_url="https://bczfskny6zqw.poweredby.snova.ai/v1",
    api_key="your-mara-api-key",
)
Don't have an API key? Follow the API Keys and URLs page to generate one.

Non-streaming completions

python
completion = client.chat.completions.create(
    model="MiniMax-M2.5",
    messages=[
        {"role": "system", "content": "Answer the question in a couple sentences."},
        {"role": "user", "content": "Share a happy story with me"},
    ],
)

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

Streaming completions

python
completion = client.chat.completions.create(
    model="MiniMax-M2.5",
    messages=[
        {"role": "system", "content": "Answer the question in a couple sentences."},
        {"role": "user", "content": "Share a happy story with me"},
    ],
    stream=True,
)

for chunk in completion:
    print(chunk.choices[0].delta.content, end="")
Note: In streaming mode, the API returns chunks that may contain multiple tokens. When calculating metrics like tokens per second, ensure you account for all tokens in each chunk.

Unsupported OpenAI parameters

The following OpenAI parameters are not currently supported and will be ignored:
ParameterDescription
logprobs, top_logprobsLog probabilities for output tokens
nNumber of completions to generate
presence_penalty, frequency_penaltyRepetition control penalties
logit_biasToken likelihood adjustments
seedDeterministic output seeding

Notable differences

FeatureMARA CloudOpenAI
temperature range0 to 10 to 2
top_k parameterSupportedNot available

Next steps