Jul 30, 2026

Use open-weight models with the OpenAI SDK

If you already have code written against the OpenAI SDK, you do not need to rewrite it to run
open-weight models. The vx-build.ai gateway speaks the same wire format, so the only thing that
changes is the base URL and the key.

Two lines of setup

from openai import OpenAI

client = OpenAI(
    base_url="https://vx-build.ai/v1",
    api_key="vxb_your_key",
)
r = client.chat.completions.create(
    model="meta-llama/llama-3.3-70b-instruct",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(r.choices[0].message.content)

That is the whole integration. Streaming works the same way — pass stream=True and you get
server-sent events, exactly as you would from OpenAI.

Picking a model

Call list models or browse the catalog to see everything available with its context
window and price. The list is pulled live from the upstream provider and filtered to open-weight
families, so new releases show up automatically and model IDs never go stale.

A few reasonable starting points:

What it costs

There are no plans or minimums. You top up prepaid credits and usage is billed at the provider cost
plus 25%, so the price you see on the catalog is the price you pay. When your balance hits
zero the API returns a 402 instead of silently failing, and credits never expire.

Why open weights

Open-weight models have closed much of the quality gap, and they bring two things closed models do
not: you can see what you are running, and you are not locked to one vendor pricing your workload.
Switching between families is a one-line model change when everything speaks the same API.

← Blog