DEV Community

Saathwik
Saathwik

Posted on

How to call Mark 1x-27B with the OpenAI Python SDK

I'm Saathwik, founder of Saanora, and I'm building Mark. This post is a short setup guide for Mark 1x-27B, our latest model, using the OpenAI Python SDK you probably already have.

You can try the model in the browser with no signup at saanora.com. The rest of this article is about calling it from code.

What you get

The API is OpenAI-compatible. Point the client at https://api.saanora.com/v1 and set the model to mark-1x-27b. Chat completions, streaming, tool calling, and image input all use the usual request shape. Context is 262K. You can set reasoning_effort to low, medium, or high. Medium is the default, and it is also how we ran the scores below.

Price is $0.10 per 1M input tokens and $0.60 per 1M output tokens, with free credit to start. Create a key in the API console and put it in SAANORA_API_KEY.

Scores at medium effort: GPQA 84.7, level with the best open models its size; AIME25 86.7; HMMT Feb26 73.5. The longer write-up is on our blog.

A minimal request

# mark.py: pip install openai, then python mark.py
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.saanora.com/v1",
    api_key=os.environ["SAANORA_API_KEY"],
)
r = client.chat.completions.create(
    model="mark-1x-27b",
    messages=[{"role": "user", "content": "How many prime numbers are there below 100?"}],
)
print(r.choices[0].message.content)
Enter fullscreen mode Exit fullscreen mode

The answer is in choices[0].message.content.

Turn thinking up on a hard problem

The model's thinking comes back in a separate reasoning field, not mixed into the answer. Higher effort costs more time and more output tokens, so I use high for proofs, tricky bugs, and long plans, and leave the default alone for everyday questions.

r = client.chat.completions.create(
    model="mark-1x-27b",
    messages=[{"role": "user", "content": "Prove that the square root of 2 is irrational."}],
    reasoning_effort="high",  # low | medium (default) | high
)
print(r.choices[0].message.reasoning)
print(r.choices[0].message.content)
Enter fullscreen mode Exit fullscreen mode

max_tokens includes the reasoning and defaults to 32,768. If a hard problem may think for a long time, raise that budget and stream the response.

A catch on the first request

The model scales down when no one is using it. After a quiet period, the first request can return 503 while it starts, which can take a few minutes. That request is not charged. The OpenAI SDK's built-in retry is usually not enough, so I retry until it answers:

import time
import openai

for attempt in range(10):
    try:
        r = client.chat.completions.create(
            model="mark-1x-27b",
            messages=messages,
            stream=True,
        )
        break
    except openai.APIStatusError as e:
        if e.status_code != 503:
            raise
        time.sleep(int(e.response.headers.get("retry-after", "30")))
Enter fullscreen mode Exit fullscreen mode

What I'd like back

If you try this in an editor extension, a coding agent, or a plain script, tell me what worked and what broke. I'm around in the comments.

Top comments (0)