- Resources
- Running Qwen3.8 on an OpenAI-compatible endpoint: a practical walkthrough

Running Qwen3.8 on an OpenAI-compatible endpoint: a practical walkthrough
Published on: 26/02/2026
Most production AI codebases look roughly the same. There is an OpenAI client instantiated somewhere, a set of prompt templates tuned over weeks of iteration, and a billing page that nobody wants to look at too closely. The model behind that client has become load-bearing infrastructure, and changing it feels risky.
Why this is worth your time
Open-weight models have reached the point where they handle the majority of production NLP tasks (classification, extraction, summarisation, conversational AI) at quality levels that are difficult to distinguish from proprietary alternatives in blind evaluation. This does not universally apply to advanced reasoning, complex tool planning, multi-step code generation, or research-grade tasks, where proprietary frontier models may still keep a measurable advantage.
The Qwen family from Alibaba's Qwen team is a strong example. Hyperfusion serves Qwen3.8-27B, a 27B dense model that accepts both text and image input, alongside gpt-oss-120b, gpt-oss-20b, Gemma 4 31B and DeepSeek-V4-Flash.
The practical obstacle to adopting these models has always been the integration cost. If your codebase is built around OpenAI's API format, switching to a different model traditionally means rewriting client code, adjusting prompt templates, and re-testing everything end to end. An OpenAI-compatible API removes most of that work.
Hyperfusion's API natively supports the OpenAI chat completions format. If your application already uses client.chat.completions.create() via the OpenAI Python SDK, switching to Qwen3.8 means updating the base URL, the API key and the model name. For standard chat completions, the request format, response structure and streaming behaviour stay the same.
What you need
A Hyperfusion account (sign up at console.hyperfusion.io), Python 3.8 or later, and the openai Python package (pip install openai). That is the complete dependency list.
Step 1: choose your model
Every model on the platform is already running on managed infrastructure in our UAE data centres, so there is nothing to deploy or size. This guide uses Qwen/Qwen3.8-27B. If your workload needs stronger reasoning, openai/gpt-oss-120b is available behind the same endpoint and the same key: switching is a change of the model parameter. The Console lists every available model with its current price.
Step 2: create an API key
In the Console, create an API key. New accounts start with $10 in free credits, enough to run an evaluation against your own prompts. Usage is billed per token and shown in the Console as you go.
Step 3: call it from your existing code
If you are currently using the OpenAI Python SDK, the migration looks like this:
# Before: calling OpenAI
from openai import OpenAI
client = OpenAI(api_key="sk-your-openai-key")
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Explain transformers"}],
)
# After: calling Qwen3.8 on Hyperfusion
from openai import OpenAI
client = OpenAI(
base_url="https://api.hyperfusion.io/v1",
api_key="your-hyperfusion-api-key",
)
response = client.chat.completions.create(
model="Qwen/Qwen3.8-27B",
messages=[{"role": "user", "content": "Explain transformers"}],
)Three values changed: base_url, api_key and model. The rest of your application, including prompt templates, streaming logic and error handling, stays as it is.
Step 4: streaming responses
If you are already using OpenAI's streaming, it works the same way:
stream = client.chat.completions.create(
model="Qwen/Qwen3.8-27B",
messages=[{"role": "user", "content": "Write a short poem"}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")The server-sent events format follows OpenAI's implementation, so frontend code that consumes streamed chunks keeps working without modification.
Image input
Qwen3.8-27B also accepts images. They are sent as image_url content parts, the same way as with OpenAI's vision-capable models:
response = client.chat.completions.create(
model="Qwen/Qwen3.8-27B",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "Extract the invoice number and total."},
{"type": "image_url", "image_url": {"url": "https://example.com/invoice.png"}},
],
}],
)A note on prompts
Qwen3.8 uses a chat template that maps cleanly to the OpenAI messages format. System, user and assistant messages all behave as expected. Prompts written for OpenAI models generally produce good results with Qwen3.8 as well, though you should run an evaluation pass to check for quality differences on your specific use case.
Instruction following is strong but not identical. For tasks that require very precise output formatting (strict JSON schemas, for example), you may need to adjust your system prompt.
Measure on your own workload
Throughput and latency depend on prompt length, output length and concurrency, so synthetic benchmark numbers say little about your application. Run your own test suite against the endpoint and compare output quality, time to first token and cost per request with your current provider.
Cost
With proprietary per-token APIs, cost scales linearly with usage at frontier-model prices. Open-weight models on Hyperfusion are also billed per token, at a fraction of those prices, and you can route simple requests to smaller models such as gpt-oss-20b. Actual savings depend on prompt length, model mix and workload shape.
When to stay on your current provider
Being straightforward about this: if your application depends heavily on top-end frontier reasoning (complex multi-step logic, advanced code generation, highly nuanced creative writing), switching to a 27B model will involve a quality trade-off. gpt-oss-120b closes part of that gap, but it is worth testing on your actual prompts before committing.
For classification, extraction, summarisation, conversational AI and other production NLP tasks, Qwen3.8 performs well enough that the cost and control advantages make the switch worthwhile.
Getting started
Sign up at console.hyperfusion.io, create an API key, and point your test suite at https://api.hyperfusion.io/v1 with the model Qwen/Qwen3.8-27B. If you have questions about model selection or your workload, write to info@hyperfusion.io.
Market Intel
Get GPU market and model usage insights to your inbox.

