LLM integration (DashScope compatible)
Bailian OpenAI-compatible docs
Sample request
bash
curl -X POST https://XXXXX/v1/chat/completions \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-plus",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Who are you?"
}
]
}'Images / vision
Glass3 delivers images as Base64. Swap in your encoded payload via"image_url": {"url": "data:image/png;base64,{base64_image}"}.
bash
curl -X POST https://XXXXX/v1/chat/completions \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "qwen-vl-plus",
"messages": [{
"role": "user",
"content": [
{"type": "image_url","image_url": {"url": "https://dashscope.oss-cn-beijing.aliyuncs.com/images/dog_and_girl.jpeg"}},
{"type": "text","text": "Describe this"}
]}]
}'Supports inline Base64 URLs:
"image_url": {"url": "data:image/png;base64,{base64_image}"}Response modes
Glass3 defaults to streaming chunks—keep your client on streaming mode for parity.
Non-streaming sample
json
{
"choices": [
{
"message": {
"role": "assistant",
"content": "I am Tongyi Qianwen ..."
},
"finish_reason": "stop",
"index": 0,
"logprobs": null
}
],
"object": "chat.completion",
...
}Streaming responses arrive as chunked chat.completion.chunk objects (omit non-stream payloads when wiring SSE parsers).