Python quickstart

Make one Qwen API request from Python

Start with a short non-streaming request. Confirm the response and usage before adding framework code.

Planned recharge methods: Alipay and USDT. Collection is not enabled yet.

Before running

  • Install the current OpenAI Python package.
  • Set the API key in an environment variable.
  • Copy a public Qwen model name.
  • Keep the script out of browser or client applications.
quickstart.pypython
from openai import OpenAI

client = OpenAI(
    api_key="qh_live_...",
    base_url="http://localhost:4000/v1",
)

response = client.chat.completions.create(
    model="qwen3.7-plus",
    messages=[{"role": "user", "content": "Explain this error log."}],
)

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

Common questions

Is the API compatible with the OpenAI SDK?

The public gateway follows the OpenAI-compatible chat completions pattern. Confirm model-specific features in the live catalog and documentation before production rollout.

Where do model availability and prices come from?

Public model pages read the active catalog exposed by the service. A model is not presented as available merely because its name appears in an article.

Related resources