Integration guides · 2026-12-01

Mark 1x-27B API: reasoning levels, tool calls and images

Call Mark 1x-27B on LLMTR with the OpenAI SDK: reasoning levels, reasoning_content, room in max_tokens, tool calling, image input and streaming.

Diagram: a saanora/mark-1x-27b box under the https://llmtr.com/v1 address and small boxes named low, medium, high, none, reasoning_content, tools, image_url and stream.

Short answer: model saanora/mark-1x-27b, endpoint https://llmtr.com/v1/chat/completions

LLMTR is a gateway that gives access to language models from different providers through one OpenAI-compatible API. To use Saanora's Mark 1x-27B, set base_url to https://llmtr.com/v1 and model to saanora/mark-1x-27b in the OpenAI SDK. Mark thinks before it answers and returns that reasoning apart from the answer. It reads text and images, and input and output share one window of 262,144 tokens. The price per 1M tokens is $0.10 for input and $0.60 for output.

The id saanora/mark-1x-27b-free accepts the same request format and is free until 7 December 2026, 24:00 (TRT); it closes earlier if free use ends sooner, and once closed it returns 410 model_retired and recommends the paid saanora/mark-1x-27b. On that id, an answer is at most 32,768 tokens when you send no max_tokens. A value above 65,536 is lowered to 65,536.

How do you call the Mark 1x-27B API through LLMTR?

Your OpenAI client is enough, but get two things right from the start. One is max_tokens: reasoning tokens count against this limit too, so a small value chosen for the length of the answer you expect may not be enough. The other is how you read the response: the final answer is in message.content and the reasoning in message.reasoning_content. The example reads the two separately, catches an empty answer early and prints finish_reason and completion_tokens.

Python example that calls saanora/mark-1x-27b at the low reasoning level and reads the reasoning apart from the answer. Replace llmtr-your_key with your own key.

from openai import OpenAI

client = OpenAI(base_url="https://llmtr.com/v1", api_key="llmtr-your_key", timeout=180)

response = client.chat.completions.create(
    model="saanora/mark-1x-27b",
    messages=[
        {"role": "system", "content": "Give the result and one line of explanation."},
        {"role": "user", "content": "A job takes 4 workers 6 hours. How long does it take 3 workers?"},
    ],
    reasoning_effort="low",
    max_tokens=4096,
)

choice = response.choices[0]
if choice.finish_reason == "length" and not choice.message.content:
    raise SystemExit("max_tokens ran out while the model was still thinking")

print("reasoning:", getattr(choice.message, "reasoning_content", None))
print("answer:", choice.message.content)
print("finish_reason:", choice.finish_reason)
print("completion_tokens:", response.usage.completion_tokens)

Reasoning levels and room in max_tokens

You pick the level with the reasoning_effort field. You can make the same choice with a reasoning object in the body or with a suffix on the model id; in the OpenAI Python SDK, the reasoning object goes in extra_body. For short and easy jobs, try a lower level and compare the answers on your own examples.

  • Setting reasoning to false in the body also turns thinking off. Another level, such as minimal or xhigh, and an unknown suffix return 400 invalid_request.
  • include_reasoning: false is not applied; the field is removed from the body and named in the llmtr_dropped_parameters field of the response. If you do not want users to see the reasoning, show them the content field.
  • Reasoning tokens are counted in completion_tokens and billed at the output price. Assume a request with 1,000 input tokens and 4,000 output tokens, reasoning included: input costs $0.0001, output $0.0024 and the total is $0.0025.
  • If content is empty and finish_reason is length, the limit ran out before the reasoning finished. Raise max_tokens or choose a lower level. Leave plenty of room from the start for hard questions.
Reasoning levels of Mark 1x-27B on LLMTR
reasoning_effortBehaviourId suffix
lowthinks less:low
mediumthe default:medium
highthinks more:high
noneanswers without thinking:none

Tool calling: answer every call

Mark uses the standard tools field. For tool_choice you can pick auto, required or a named function. The model can return more than one tool call in a single turn. Your loop therefore has to walk the whole tool_calls array and add a separate tool message for each call, carrying that call's tool_call_id. On a turn where you want no tool to be used, leave tools out: a request that sends tool_choice none together with tools can come back with an empty answer.

The example reads the order statuses the model asks for from a dictionary and runs at most four rounds. In a real application, validate the arguments the model produces before you pass them to a database or another service, and ask for approval before a tool changes data.

Python example that asks Mark 1x-27B about two orders, answers every tool call it returns and limits the number of rounds.

import json

from openai import OpenAI

client = OpenAI(base_url="https://llmtr.com/v1", api_key="llmtr-your_key", timeout=180)

ORDERS = {"A-1001": "shipped", "A-1002": "preparing"}
TOOLS = [
    {
        "type": "function",
        "function": {
            "name": "get_order_status",
            "description": "Return the status of one order",
            "parameters": {
                "type": "object",
                "properties": {"order_id": {"type": "string"}},
                "required": ["order_id"],
            },
        },
    }
]

messages = [{"role": "user", "content": "Check the orders A-1001 and A-1002."}]

for _ in range(4):
    response = client.chat.completions.create(
        model="saanora/mark-1x-27b",
        messages=messages,
        tools=TOOLS,
        tool_choice="auto",
        max_tokens=8192,
    )
    message = response.choices[0].message
    if not message.tool_calls:
        print(message.content)
        break
    messages.append(
        {
            "role": "assistant",
            "content": message.content,
            "tool_calls": [call.model_dump() for call in message.tool_calls],
        }
    )
    for call in message.tool_calls:
        arguments = json.loads(call.function.arguments)
        status = ORDERS.get(arguments.get("order_id"), "unknown order")
        messages.append({"role": "tool", "tool_call_id": call.id, "content": status})
else:
    print("stopped after four rounds without a final answer")

Image input

Put the image in the content array as an image_url part. The url field can be a public https address or a base64 data URL. A request body over about 4.5 MB returns 413 invalid_request. Base64 encoding makes a file larger, so send large images as https addresses or shrink them. The input_file part type is not supported; to use a document, extract its text and send it as a text part. Before you act on an amount or a number read from an image, compare it with your own records.

Python example that sends a local PNG file to Mark 1x-27B as a base64 data URL.

import base64

from openai import OpenAI

client = OpenAI(base_url="https://llmtr.com/v1", api_key="llmtr-your_key", timeout=180)

with open("invoice.png", "rb") as f:
    data_url = "data:image/png;base64," + base64.b64encode(f.read()).decode("ascii")

response = client.chat.completions.create(
    model="saanora/mark-1x-27b",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Read the invoice number and the total amount."},
                {"type": "image_url", "image_url": {"url": data_url}},
            ],
        }
    ],
    max_tokens=4096,
)

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

Streaming: reading the reasoning and the answer separately

Use stream for requests that you expect to produce long answers, because a long unstreamed request can time out. The reasoning arrives piece by piece in delta.reasoning_content and the answer in delta.content. If you set include_usage in stream_options, the last chunk carries the usage field. The example writes the reasoning to standard error and the answer to standard output, so the two do not mix.

At busy times or after a quiet period, a request can be refused with 503. Wait for the Retry-After time, try again and set your client timeout to at least 120 seconds. The example uses 180 seconds and raises the OpenAI SDK's retry count with max_retries.

Python example that streams Mark 1x-27B, writes the reasoning and the answer to separate channels and then shows finish_reason and the token count.

import sys

from openai import OpenAI

client = OpenAI(
    base_url="https://llmtr.com/v1",
    api_key="llmtr-your_key",
    timeout=180,
    max_retries=5,
)

stream = client.chat.completions.create(
    model="saanora/mark-1x-27b",
    messages=[{"role": "user", "content": "Plan a move from polling a REST API to webhooks."}],
    reasoning_effort="high",
    max_tokens=16384,
    stream=True,
    stream_options={"include_usage": True},
)

finish_reason = None
usage = None
for chunk in stream:
    if chunk.usage:
        usage = chunk.usage
    if not chunk.choices:
        continue
    finish_reason = chunk.choices[0].finish_reason or finish_reason
    delta = chunk.choices[0].delta
    thought = getattr(delta, "reasoning_content", None)
    if thought:
        sys.stderr.write(thought)
    if delta.content:
        sys.stdout.write(delta.content)
        sys.stdout.flush()

print()
print("finish_reason:", finish_reason)
if usage:
    print("completion_tokens:", usage.completion_tokens)

When the answer comes back empty or unexpected

The behaviours below are easy to miss in client code. This model is provided through a third-party provider.

  • A stop sequence also matches inside the reasoning. If it matches there, the answer comes back empty; avoid short, common strings or turn thinking off with none.
  • For JSON output, use response_format with json_object or a strict json_schema. Leave room for the reasoning, and confirm that finish_reason is stop before you parse the output.
  • When max_tokens and max_completion_tokens both arrive, max_completion_tokens applies; a different max_tokens value is named in llmtr_dropped_parameters.
  • A response carries one choice. An n other than 1 is removed from the body and named in the same field.
  • If the prompt plus max_tokens exceeds the window, the request returns 400 invalid_request and is not billed. Shorten the history or lower max_tokens.

Calling Mark 1x-27B through LLMTR

Point an OpenAI client at LLMTR, send a request with a max_tokens that leaves room for reasoning and check the answer together with finish_reason.

  1. Key. Create an API key on llmtr.com, top up your balance and put your key where the example says llmtr-your_key.
  2. Request. Set base_url to https://llmtr.com/v1 and the model to saanora/mark-1x-27b, pick a reasoning_effort and give a max_tokens with room for the reasoning.
  3. Check. Look at finish_reason, read the answer from content and the reasoning from reasoning_content, and watch the usage counts.

Frequently asked questions

Can you turn off reasoning on Mark 1x-27B?

Yes. Set reasoning_effort to none, add the :none suffix to the model id or send reasoning as false in the body.

Why is the content field of Mark 1x-27B empty?

Check three cases: if finish_reason is length, max_tokens ran out before the reasoning finished; a stop sequence may have matched during the reasoning; and a request that sends tool_choice none together with tools can also come back empty.

Are reasoning tokens billed?

Yes. They are counted in completion_tokens, billed at the output price of $0.60 per 1M tokens and included in the max_tokens limit.

Related posts