Install and configure
python -m pip install openaiSet VECTIDE_API_KEY and VECTIDE_MODEL in the environment running your program. You can start with glm-5.3 if your plan includes it. Inject credentials into the process instead of committing them in source code.
A minimal request
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["VECTIDE_API_KEY"],
base_url="https://vectide.cn/v1",
timeout=60.0,
max_retries=0,
)
response = client.chat.completions.create(
model=os.environ["VECTIDE_MODEL"],
messages=[{"role": "user", "content": "Reply with a short greeting."}],
stream=False,
)
print(response.choices[0].message.content)Automatic retries are disabled here to make the first request easier to inspect. Before production use, add bounded retry and timeout behavior appropriate to the error, and reconcile any repeated usage.
Separate SDK and service issues
| Symptom | Check |
|---|---|
| Missing environment variable | Confirm the variables reach the terminal or service process running Python. |
| 401 / 403 | Check credentials, account and model entitlement without logging the full key. |
| 404 | Keep base_url at /v1; do not append /chat/completions. |
| curl works; SDK fails | Compare model ID, base_url, SDK version and additional parameters. |
| Response returned; task failed | Inspect completion and application parsing, tools and context settings. |
After setup
Validate streaming, tools and optional fields with your selected model and workload before increasing usage. The example follows the official SDK client pattern; your account access must be checked with your own credentials.