LOADING
( API ) — YuazLLM 3B MoE

API 三种格式

同一个模型,三种调用方式:原子格式(网页服务在用的原生格式)、 OpenAI 兼容、Claude 兼容。三种都支持流式与非流式。

鉴权:公开免鉴权 限流:150 次/分钟 max_tokens:≤ 500 思考链:≤ 500 字(与回复分开) 上下文:1024 字 · 最多 8 轮 模型名:yuaz-llm-3b-moe
POSThttps://ai.yuaz.club/api/ai/chat

网页对话页正在使用的原生格式:只传本轮 message 与历史 history,超长由服务端自动剔除最旧轮次(最多保留最近 8 轮)。

请求体
{
  "message": "你好",
  "history": [
    { "role": "user", "content": "上一句" },
    { "role": "assistant", "content": "上一句的回复" }
  ],
  "stream": false,
  "max_new_tokens": 500,
  "temperature": 0.7,
  "top_k": 20,
  "top_p": 0.9,
  "repetition_penalty": 1.15,
  "force_think": false
}
参数说明
max_new_tokens   回复字数上限,1–500(默认 500)
force_think      强制思考模式:true 时服务端在助手回合前预填思考标签,
                 让模型先输出思考过程;思考最多 500 字,与回复字数分开计算。
                 思考超过 500 字仍未作答时,服务端会自动截断思考链并继续生成答案。
history          最多保留最近 8 轮,超出自动丢弃最早的整轮。
响应(非流式)
{
  "success": true,
  "reply": "我是元晦(Yuaz LLM YuAn Hui),原子漫画社……",
  "time": "8.2s",
  "device": "Vulkan GPU (元晦 3B MoE SFT-v3)",
  "thinking": "用户问我是谁,先简单介绍自己。",
  "sources": [],
  "prompt_tokens": 12,
  "completion_tokens": 42,
  "tools_used": 0,
  "rounds": 1,
  "context_truncated": false,
  "dropped_rounds": 0
}
流式(stream: true)
event: think                      ← 思维链增量(前端可折叠展示)
data: {"delta":"我先想想…"}

event: sources                    ← 联网搜索命中时返回来源
data: {"items":[{"title":"原神_百度百科","url":"https://baike.baidu.com/…"}]}

event: meta                       ← 进度 / 上下文状态
data: {"status":"thinking","context_truncated":false,"dropped_rounds":0}

data: {"token":"我"}
data: {"token":"是"}

event: usage                      ← 本次 token 用量
data: {"prompt_tokens":12,"completion_tokens":8}

event: meta
data: {"tools_used":0,"rounds":1,"context_truncated":false,"dropped_rounds":0}

data: [DONE]
curl
curl -N -X POST https://ai.yuaz.club/api/ai/chat \
  -H 'Content-Type: application/json' \
  -d '{"message":"你好","stream":true}'
POSThttps://ai.yuaz.club/v1/chat/completions
GEThttps://ai.yuaz.club/v1/models

兼容 OpenAI Chat Completions。把 SDK 的 base_url 指到 https://ai.yuaz.club/v1,api_key 随便填即可。

请求体
{
  "model": "yuaz-llm-3b-moe",
  "messages": [
    { "role": "system", "content": "你是一个友好的助手" },
    { "role": "user", "content": "你好" }
  ],
  "max_tokens": 500,
  "temperature": 0.7,
  "reasoning_effort": "medium",
  "stream": false
}
思考开关(OpenAI 原生字段 reasoning_effort)
reasoning_effort: "none" | "minimal"   → 关闭思考(默认)
reasoning_effort: "low" | "medium" | "high" → 打开思考,先思考再作答

开启后,思维链以 reasoning_content 返回(与 DeepSeek 等实现一致,
Cherry Studio / ChatBox / LobeChat / Open WebUI 等会渲染成「思考过程」):
  非流式:choices[0].message.reasoning_content
  流式  :choices[0].delta.reasoning_content

兼容写法:thinking: {"type":"enabled"} 或 force_think: true 也可打开思考。
思考长度上限 500 字,与回复字数分开计算。
响应(非流式,开启思考时)
{
  "id": "chatcmpl-xxxxxxxx",
  "object": "chat.completion",
  "created": 1789187000,
  "model": "yuaz-llm-3b-moe",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "reasoning_content": "用户问我是谁,先简单介绍自己。",
        "content": "我是元晦……"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0 }
}
响应(非流式)
{
  "id": "chatcmpl-xxxxxxxx",
  "object": "chat.completion",
  "created": 1789187000,
  "model": "yuaz-llm-3b-moe",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "我是元晦……" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0 }
}
流式(标准 SSE chunk,含思考增量)
data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"reasoning_content":"我先想想"},"finish_reason":null}]}

data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"我"},"finish_reason":null}]}

data: {"...":"...","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}

data: [DONE]
Python(openai SDK)
from openai import OpenAI

client = OpenAI(base_url="https://ai.yuaz.club/v1", api_key="not-needed")
resp = client.chat.completions.create(
    model="yuaz-llm-3b-moe",
    messages=[{"role": "user", "content": "你好"}],
)
print(resp.choices[0].message.content)
curl
curl -N https://ai.yuaz.club/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer not-needed' \
  -d '{"model":"yuaz-llm-3b-moe","messages":[{"role":"user","content":"你好"}],"stream":true}'
POSThttps://ai.yuaz.club/v1/messages

兼容 Anthropic Messages API(含 system 字段与内容块数组,以及助手预填续写)。

请求体
{
  "model": "yuaz-llm-3b-moe",
  "max_tokens": 500,
  "system": "你是一个友好的助手",
  "messages": [
    { "role": "user", "content": "你好" }
  ],
  "thinking": { "type": "enabled", "budget_tokens": 500 },
  "stream": false
}
思考开关(Claude 原生字段 thinking)
{ "thinking": { "type": "enabled", "budget_tokens": 500 } }  → 打开思考
{ "thinking": { "type": "disabled" } }                        → 关闭思考(默认)

budget_tokens 为思考字数预算,本服务允许 1–500,超出按 500 截断
(官方 Claude 要求 ≥1024,这里按实际模型能力收敛)。
思考达到预算仍未作答时,服务端会自动截断思考链并继续生成答案。
兼容写法:reasoning_effort 或 force_think 也可打开思考。
响应(非流式,开启思考时)
{
  "id": "msg_xxxxxxxx",
  "type": "message",
  "role": "assistant",
  "model": "yuaz-llm-3b-moe",
  "content": [
    { "type": "thinking", "thinking": "用户问我是谁,先简单介绍自己。" },
    { "type": "text", "text": "我是元晦……" }
  ],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": { "input_tokens": 0, "output_tokens": 0 }
}
响应(非流式)
{
  "id": "msg_xxxxxxxx",
  "type": "message",
  "role": "assistant",
  "model": "yuaz-llm-3b-moe",
  "content": [ { "type": "text", "text": "我是元晦……" } ],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": { "input_tokens": 0, "output_tokens": 0 }
}
流式(Anthropic 事件序列,含 thinking 块)
event: message_start
data: {"type":"message_start","message":{"id":"msg_xxx","role":"assistant","content":[]}}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"thinking","thinking":""}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"thinking_delta","thinking":"我先想想"}}

event: content_block_stop
data: {"type":"content_block_stop","index":0}

event: content_block_start
data: {"type":"content_block_start","index":1,"content_block":{"type":"text","text":""}}

event: content_block_delta
data: {"type":"content_block_delta","index":1,"delta":{"type":"text_delta","text":"我"}}

event: content_block_stop
data: {"type":"content_block_stop","index":1}

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":1}}

event: message_stop
data: {"type":"message_stop"}
Python(anthropic SDK)
from anthropic import Anthropic

client = Anthropic(base_url="https://ai.yuaz.club", api_key="not-needed")
msg = client.messages.create(
    model="yuaz-llm-3b-moe",
    max_tokens=500,
    messages=[{"role": "user", "content": "你好"}],
)
print(msg.content[0].text)
curl
curl -N https://ai.yuaz.club/v1/messages \
  -H 'Content-Type: application/json' \
  -H 'anthropic-version: 2023-06-01' \
  -H 'x-api-key: not-needed' \
  -d '{"model":"yuaz-llm-3b-moe","max_tokens":500,"messages":[{"role":"user","content":"你好"}]}'

试一试

结果会显示在这里(非流式)。

单功能 API · 可单独调用

这里只开放模型特有的能力:工具判断、文案总结、视觉小说选项、角色台词。均为 POST + JSON,公开免鉴权。
计算、联网检索、思考属于对话内部的基础能力,不单独开放——需要它们时直接走对话接口即可。

POSThttps://ai.yuaz.club/api/ai/tools/route

只做工具判断:这句话该不该调工具、调哪一个。返回打分与决策依据,不生成正文,约 2 秒。

curl https://ai.yuaz.club/api/ai/tools/route \
  -H 'Content-Type: application/json' \
  -d '{"message":"今天有什么值得关注的科技新闻?"}'

{"success":true,"tool":"<search>","reason":"keyword","p_lt":null,"scores":{},
 "thresholds":{"p_lt":0.5,"log_tag":-0.5}}

reason 取值:keyword 命中检索意图词、score 概率达标、 p_lt_low / score_low 未达阈值、no_tools 工具全关。
tool 为 null 表示这一轮不该调用工具。

POSThttps://ai.yuaz.club/api/ai/tools/summary

只做文案总结:从原文抽要点,数字只用原文里出现过的。返回 items 数组(默认 3 条)。

curl https://ai.yuaz.club/api/ai/tools/summary \
  -H 'Content-Type: application/json' \
  -d '{"text":"公司今年营收同比增长百分之十八,其中海外业务贡献最大,新产品的复购率达到百分之四十,明年计划进入东南亚市场。","count":3}'

{"success":true,"tool":"summary","text":"…",
 "items":["公司今年营收同比增长百分之十八","海外业务贡献最大","新产品复购率达到百分之四十"]}
POSThttps://ai.yuaz.club/api/ai/tools/choice

只做视觉小说选项:给一段情境,产出可点击的选项。返回 items 数组(默认 3 个)。

curl https://ai.yuaz.club/api/ai/tools/choice \
  -H 'Content-Type: application/json' \
  -d '{"context":"深夜,你站在窗边,看到楼下有人抬头看你。","count":3}'

{"success":true,"tool":"choice","text":"…",
 "items":["停在原地看着","把窗帘放进去","把门关上"]}
POSThttps://ai.yuaz.club/api/ai/tools/line

只做角色台词:给角色和情境,产出一句台词。

curl https://ai.yuaz.club/api/ai/tools/line \
  -H 'Content-Type: application/json' \
  -d '{"role":"旁白","context":"雨夜的车站"}'

{"success":true,"tool":"line","text":"窗外灯光暗,窗外的人不必多问,我们一起去看看。"}