Claude Code 指南
設定 Flaq AI Claude 模型並探索 Claude Code 技能
透過 Flaq AI 穩定、實惠的 API 體驗 OpenAI GPT 6 Luna API,支援文字生成、寫作、程式設計和對話,並提供串流回應。把文字創作和對話能力接入應用程式,在開發流程中處理文字任務。
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: 'gpt-6-luna-text-to-text',
messages: [
{
role: 'user',
content: 'Write a concise product update for a developer audience.'
}
],
stream: true,
max_tokens: 2048
})
});
if (!response.ok) {
const errorBody = await response.json().catch(() => null);
throw new Error(errorBody?.error?.message ?? errorBody?.message ?? `HTTP ${response.status}`);
}
const reader = response.body.getReader();
const decoder = new TextDecoder();
let buffer = '';
let assistantText = '';
while (true) {
const { done, value } = await reader.read();
if (done) break;
buffer += decoder.decode(value, { stream: true });
const frames = buffer.split(/\r?\n\r?\n/);
buffer = frames.pop() || '';
for (const frame of frames) {
const lines = frame.split(/\r?\n/).filter(Boolean);
let eventName = 'message';
const dataLines = [];
for (const line of lines) {
if (line.startsWith('event:')) {
eventName = line.slice(6).trim();
} else if (line.startsWith('data:')) {
dataLines.push(line.replace(/^data:\s*/, ''));
}
}
const raw = dataLines.join('\n').trim();
if (raw === '[DONE]') {
console.log('\nFinal text:', assistantText);
continue;
}
let payload;
try {
payload = JSON.parse(raw);
} catch {
continue;
}
if (eventName === 'error' || payload.error) {
const msg = payload.error?.message ?? payload.message ?? 'Chat request failed';
throw new Error(msg);
}
const delta = payload.choices?.[0]?.delta;
if (delta?.content) {
assistantText += delta.content;
console.log(assistantText);
}
}
}
import json
import requests
response = requests.post(
'https://api.flaq.ai/api/v1/chat/completions',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'text/event-stream',
'Content-Type': 'application/json',
},
json={
'model': 'gpt-6-luna-text-to-text',
'messages': [
{
'role': 'user',
'content': 'Write a concise product update for a developer audience.',
}
],
'stream': True,
'max_tokens': 2048,
},
stream=True,
)
response.raise_for_status()
event_name = 'message'
assistant_text = ''
for raw_line in response.iter_lines(decode_unicode=True):
if not raw_line:
event_name = 'message'
continue
if raw_line.startswith('event:'):
event_name = raw_line.replace('event:', '', 1).strip()
continue
if raw_line.startswith('data:'):
raw_data = raw_line.replace('data:', '', 1).strip()
if raw_data == '[DONE]':
print('\nFinal text:', assistant_text)
continue
payload = json.loads(raw_data)
if event_name == 'error' or payload.get('error'):
error = payload.get('error') or payload
raise RuntimeError(error.get('message', 'Chat request failed'))
choices = payload.get('choices') or []
if choices:
delta = choices[0].get('delta') or {}
content = delta.get('content')
if content:
assistant_text += content
print(content, end='', flush=True)
curl -N -X POST "https://api.flaq.ai/api/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: text/event-stream" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-luna-text-to-text",
"messages": [
{
"role": "user",
"content": "Write a concise product update for a developer audience."
}
],
"stream": true,
"max_tokens": 2048
}'
| 參數 | 價格 | 原價 | 折扣 |
|---|
Flaq AI 上的 GPT 6 Luna 文字生成 API 為目標明確的大量語言任務提供 OpenAI GPT-6 系列中具成本效益的選擇。GPT-6 Luna 專為反應迅速的使用者體驗和正式環境工作流程打造,協助開發者建立對話助理、內容管線、程式開發實用工具和知識工具,無須管理模型基礎設施。
注意 請確保提示詞和應用程式工作流程符合 OpenAI 的安全與使用指南以及 Flaq AI 條款。如果發生錯誤,請檢查提示詞是否包含受限內容,調整指令後再試一次。
GPT 6 Luna 與 GPT 6 Sol
GPT 6 Sol 專為深入的多步驟推理、複雜軟體架構和高強度技術寫作而設計。GPT 6 Luna 優先考量快速生成和經濟實惠的運作成本,是大量且對延遲敏感的正式環境的理想選擇。
GPT 6 Luna 與 GPT 5.6 Luna
GPT 5.6 Luna 是用於高效率文字工作流程的較早選擇。GPT 6 Luna 將更新的 GPT-6 系列帶入重視特定任務和大量使用的應用程式;遷移前,請使用自己的提示詞比較品質與成本。
GPT 6 Luna 與 Claude Fable 模型
Claude Fable 模型服務於 Anthropic 生態系統中要求較高的推理工作。對於優先考量目標明確的大量對話任務的團隊,GPT 6 Luna 是以 OpenAI 為基礎的選擇。
GPT 6 Luna 與自行託管的開源模型
自行託管開放模型需要團隊管理模型服務和基礎設施。GPT 6 Luna 提供託管式 API 存取,適合希望在文字工作流程中使用託管模型的團隊。
設定 Flaq AI Claude 模型並探索 Claude Code 技能

設定 Flaq AI GPT 模型並探索 Codex 技能
在 Hermes Agent 中使用 Flaq AI LLM 模型
在 ZCode 中使用 GLM 5.2、Kimi K3 和 DeepSeek v4
使用 Flaq AI DeepSeek 模型執行 DeepSeek Harness
將 AI 代理連接至 Flaq 圖片和影片生成工具
在 WorkBuddy 中使用 GPT 6 Astra 和 Claude Fable 5.1