JavaScript quickstart

Call a supported Qwen model from Node.js

Use environment variables for the key and base URL so deployment environments can change without editing application code.

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

Production notes

  • Use a server runtime.
  • Set a request timeout.
  • Handle rate-limit and upstream errors explicitly.
  • Log the request ID without logging the API key.
quickstart.tstypescript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.QINGHENG_API_KEY,
  baseURL: process.env.QINGHENG_BASE_URL,
});

const response = await client.chat.completions.create({
  model: "qwen3.7-plus",
  messages: [{ role: "user", content: "Summarize this incident." }],
});

console.log(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