Qwen 3.7 API
Alibaba 기반 Qwen 3.7 LLM 모델의 전체 API 참조입니다.
모델 변형
이 API는 네 가지 Qwen 3.7 모델 변형을 지원합니다:
빠른 비교
Qwen 3.7 Max Text to Text
엔드포인트 {#}
POST /api/v1/chat/completions
요청 매개변수
필수
메시지 지원
선택 사항
예시 요청
const response = await fetch('https://api.flaq.ai/api/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'text/event-stream',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'qwen-3.7-max-text-to-text',
messages: [
{
role: 'user',
content: 'Explain the concept of attention mechanisms in neural networks.'
}
],
stream: true,
max_tokens: 2048
})
});
Qwen 3.7 Plus Text to Text
엔드포인트
POST /api/v1/chat/completions
요청 매개변수
필수
메시지 지원
선택 사항
예시 요청
const response = await fetch('https://api.flaq.ai/api/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'text/event-stream',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'qwen-3.7-plus-text-to-text',
messages: [
{
role: 'user',
content: 'Explain the concept of attention mechanisms in neural networks.'
}
],
stream: true,
max_tokens: 2048
})
});
Qwen 3.7 Max Web Search
엔드포인트
POST /api/v1/chat/completions
요청 매개변수
필수
메시지 지원
선택 사항
예시 요청
const response = await fetch('https://api.flaq.ai/api/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'text/event-stream',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'qwen-3.7-max-web-search',
messages: [
{
role: 'user',
content: 'What are the latest developments in quantum computing this year?'
}
],
stream: true,
max_tokens: 2048
})
});
Qwen 3.7 Plus Web Search
엔드포인트
POST /api/v1/chat/completions
요청 매개변수
필수
메시지 지원
선택 사항
예시 요청
const response = await fetch('https://api.flaq.ai/api/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'text/event-stream',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'qwen-3.7-plus-web-search',
messages: [
{
role: 'user',
content: 'What are the latest developments in quantum computing this year?'
}
],
stream: true,
max_tokens: 2048
})
});
응답 형식
Qwen 3.7 LLM models return OpenAI-compatible completion responses. With stream: true, the response is Server-Sent Events; with stream: false, the response is a single JSON object.
성공 응답
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":1710000000,"model":"qwen-3.7-max-text-to-text","choices":[{"index":0,"delta":{"role":"assistant"},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":1710000000,"model":"qwen-3.7-max-text-to-text","choices":[{"index":0,"delta":{"content":"Here is a concise explanation"},"finish_reason":null}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":1710000000,"model":"qwen-3.7-max-text-to-text","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk","created":1710000000,"model":"qwen-3.7-max-text-to-text","choices":[],"usage":{"prompt_tokens":12,"completion_tokens":8,"total_tokens":20}}
data: [DONE]
오류 응답
event: error
data: {"error":{"message":"API requests too frequent, exceeding rate limit","type":"rate_limit_error","code":"1302","param":null}}
모범 사례
- 구조화된 메시지를 사용하세요: 컨텍스트를 하나의 prompt로 평탄화하지 말고
messages[]로 대화 기록을 보내세요.
- 적절한 변형을 선택하세요: 복잡한 추론 작업에는 Max를, 빠르고 비용 효율적인 응답에는 Plus를 사용하세요. 최신 정보가 필요하면 Web Search 변형을 사용하세요.
- SSE 이벤트를 처리하세요: 스트리밍 표시에는
choices[0].delta.content를 추가하고 data: [DONE]을 성공적인 완료로 처리하세요.
- 지원되는 입력만 보내세요: Qwen 3.7 모델은 텍스트 전용이며 파일이나 이미지 첨부를 지원하지 않습니다.