/v1/chat/completions/v1/messages/v1/responses/v1beta/models/*/v1/models/*Claude Fable 5 是 Anthropic 下一代智能,专注于最难的知识工作和编程问题。它比以往任何普遍可用的 Claude 模型都能独立运行时间更长:通过代理框架运行,它可以连续工作数天,跨阶段规划,委派给子代理,并检查自身工作。
- 输入 / 输出模态
- 未提供 至 未提供
- 参考输入 / 输出价格
- 输入¥70输出¥350每百万 Token
- 上下文长度
- 1M
- 收录时间
- 2026年6月10日
供应通道与价格
| 供应通道 | 输入长度 | 输入 /M | 输出 /M | 缓存读取 /M | 上下文 | 最大输出 | 详情 |
|---|---|---|---|---|---|---|---|
| Amazon Bedrock | ≤ 272K | ¥35 | ¥210 | ¥3.5 | 1M | 128K | |
| > 272K | ¥70 | ¥315 | ¥7 | ||||
| Anthropic-C | — | ¥70 | ¥350 | ¥7 | 1M | 128K |
Claude Fable 5 的示例代码与 API 说明
Modelmesh 会帮你在不同服务提供商之间规范化处理请求和响应,为你统一接口。
Modelmesh 提供了兼容 OpenAI 的 Completion API,可连接 300 多款模型与服务提供商,既可直接调用,也可通过 OpenAI SDK 调用。此外,还提供了一些第三方 SDK。
在以下示例中,Modelmesh 专用的请求头属于可选项。若你配置了这些请求头,你的应用就能出现在 Modelmesh 的排行榜上。
支持的接口点击接口可切换下方示例
查看端点说明收起端点说明新手指南了解各端点用途,选择适合你的编程工具
端点是调用模型的入口,不同端点使用不同的请求格式。先按你使用的编程工具选择协议,再填写 Base URL、API Key 和当前模型 ID。
| 端点 | 是什么 | 主要用途 | 可对接的编程 Agent / 工具及条件 |
|---|---|---|---|
/v1/chat/completions | OpenAI 聊天格式:按 messages 传入用户、助手等角色的消息。 | 多轮对话、代码问答;模型与网关支持时可进行工具调用。 | Cline 的 OpenAI Compatible 模式、Continue 的 OpenAI 兼容配置。设置对应 Base URL、Key 和模型 ID;Continue 如自动选用 Responses,可配置 useResponsesApi: false。 |
/v1/messages | Anthropic Messages 格式:按消息和内容块组织输入、输出。 | Claude 风格对话、编程任务和工具调用。 | Claude Code:通过 ANTHROPIC_BASE_URL 连接兼容网关;需兼容消息、工具及流式事件格式。官方支持范围为 Claude 模型;其他模型的协议转换由平台适配并实测,不能仅凭此端点宣称可用。 |
/v1/responses | OpenAI Responses 格式:统一组织输入、模型输出和工具调用结果。 | 多轮任务、Agent 编程流程、工具调用。 | Codex(自定义 Provider):设置 base_url、env_key、模型 ID,协议使用 wire_api = "responses";网关需兼容工具调用和流式事件。 |
/v1beta/models/* | Gemini 测试版模型操作路径;* 代表模型名和操作,例如 {model}:generateContent。 | 生成内容、处理模型支持的多模态输入,以及使用测试版开放的功能。 | Gemini CLI(Gemini API Key 模式):使用 GOOGLE_GEMINI_BASE_URL 指向兼容网关,并匹配 v1beta 版本;需验证所选模型的生成、流式输出和工具调用。Google Gen AI SDK 也可按版本配置接入。 |
/v1/models/* | Gemini 稳定版模型操作路径,例如 /v1/models/{model}:generateContent。 | 使用稳定版开放的内容生成能力;具体功能取决于模型和接口版本。 | Gemini CLI(Gemini API Key 模式):前提是客户端实际使用 v1,且网关支持相应操作;不能仅替换地址中的版本号就认为可用。Google Gen AI SDK 可显式选择 v1。 |
使用提示
- 上表说明协议与工具的对应关系。实际可用性以当前模型、网关适配情况和工具版本为准;使用 Agent 前还需确认工具调用及流式输出可用。
*是占位符,不是可以直接请求的地址。/v1/models/*在这里指 Gemini 模型操作路径,不等于 OpenAI 查询模型列表的GET /v1/models。- Base URL 是公共地址前缀,端点是具体操作路径。 两者按 SDK 或工具的规则组合,通常不要把完整端点填进 Base URL。例如本页 OpenAI 示例的 Base URL 为
https://router.shengsuanyun.com/api/v1,Chat Completions 的完整请求地址为https://router.shengsuanyun.com/api/v1/chat/completions,不要重复拼接/v1。 - Anthropic、Gemini 的地址前缀按各自示例填写,不直接照搬 OpenAI 的 Base URL。不同工具使用的配置字段不同。
from openai import OpenAI
API_KEY = "$SSY_API_KEY"
client = OpenAI(
base_url="https://router.shengsuanyun.com/api/v1",
api_key=API_KEY,
)
try:
completion = client.chat.completions.create(
model="anthropic/claude-fable-5",
messages=[{"role": "user", "content": "9.11 和 9.8 哪个数更大?"}],
temperature=0.6,
top_p=0.7,
stream=True,
)
response_text = ""
for chunk in completion:
if chunk.choices and chunk.choices[0].delta.content is not None:
content = chunk.choices[0].delta.content
print(content, end="", flush=True)
response_text += content
except Exception as error:
print(f"Request failed: {error}")
import OpenAI from "openai";
const apiKey = "$SSY_API_KEY";
const openai = new OpenAI({
baseURL: "https://router.shengsuanyun.com/api/v1",
apiKey,
});
async function main() {
try {
const stream = await openai.chat.completions.create({
model: "anthropic/claude-fable-5",
messages: [{ role: "user", content: "9.11 和 9.8 哪个数更大?" }],
temperature: 0.6,
top_p: 0.7,
stream: true,
});
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content;
if (content) process.stdout.write(content);
}
console.log("\n[chat complete]");
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error("Request failed:", message);
process.exitCode = 1;
}
}
main();
#!/usr/bin/env bash
set -euo pipefail
API_KEY="$SSY_API_KEY"
BASE_URL="https://router.shengsuanyun.com/api/v1/chat/completions"
MODEL='anthropic/claude-fable-5'
curl --fail-with-body --silent --show-error --no-buffer -X POST "${BASE_URL}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${API_KEY}" \
-d '{
"model": "'"${MODEL}"'",
"messages": [{"role": "user", "content": "9.11 和 9.8 哪个数更大?"}],
"temperature": 0.6,
"top_p": 0.7,
"stream": true
}'
printf '\n[chat complete]\n'
import requests
API_KEY = "$SSY_API_KEY"
url = "https://router.shengsuanyun.com/api/v1/messages"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
payload = {
"model": "anthropic/claude-fable-5",
"messages": [{"role": "user", "content": "你好"}],
}
response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.json())
const apiKey = "$SSY_API_KEY";
async function main() {
const response = await fetch("https://router.shengsuanyun.com/api/v1/messages", {
method: "POST",
headers: {
Authorization: "Bearer " + apiKey,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "anthropic/claude-fable-5",
messages: [{ role: "user", content: "你好" }],
}),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`Request failed with status ${response.status}: ${text}`);
}
console.log(await response.json());
}
main().catch((error) => {
const message = error instanceof Error ? error.message : String(error);
console.error("Request failed:", message);
});
#!/usr/bin/env bash
set -euo pipefail
API_KEY="$SSY_API_KEY"
BASE_URL="https://router.shengsuanyun.com/api/v1/messages"
MODEL='anthropic/claude-fable-5'
curl --fail-with-body --silent --show-error -X POST "${BASE_URL}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${API_KEY}" \
-d '{
"model": "'"${MODEL}"'",
"messages": [{"role": "user", "content": "你好"}]
}'
from openai import OpenAI
API_KEY = "$SSY_API_KEY"
client = OpenAI(
base_url="https://router.shengsuanyun.com/api/v1",
api_key=API_KEY,
)
messages = [
{"role": "user", "content": "用100字如何描述《三国演义》。"},
]
response = client.responses.create(
model="anthropic/claude-fable-5",
input=messages,
)
print(response.output_text)
import OpenAI from "openai";
const apiKey = "$SSY_API_KEY";
const client = new OpenAI({
baseURL: "https://router.shengsuanyun.com/api/v1",
apiKey,
});
async function main() {
const messages = [
{ role: "user", content: "用100字如何描述《三国演义》。" },
];
const response = await client.responses.create({
model: "anthropic/claude-fable-5",
input: messages,
});
console.log(response.output_text);
}
main().catch((error) => {
const message = error instanceof Error ? error.message : String(error);
console.error("Request failed:", message);
});
#!/usr/bin/env bash
set -euo pipefail
API_KEY="$SSY_API_KEY"
MODEL='anthropic/claude-fable-5'
BASE_URL="https://router.shengsuanyun.com/api/v1/responses"
curl --fail-with-body --silent --show-error -X POST "${BASE_URL}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${API_KEY}" \
-d '{
"model": "'"${MODEL}"'",
"input": [
{
"role": "user",
"content": "用100字如何描述《三国演义》。"
}
]
}' | python3 -c 'import json,sys
data=json.load(sys.stdin)
text=data.get("output_text") or "".join(
part.get("text", "")
for item in data.get("output", [])
for part in item.get("content", [])
if part.get("type") == "output_text"
)
print(text)'
import requests
API_KEY = "$SSY_API_KEY"
MODEL = "anthropic/claude-fable-5"
URL = f"https://router.shengsuanyun.com/api/v1beta/models/{MODEL}:generateContent"
messages = [
{"role": "user", "content": "9.11 和 9.8 哪个数更大?"}
]
payload = {
"contents": [
{
"role": message["role"],
"parts": [{"text": message["content"]}],
}
for message in messages
],
"generationConfig": {
"temperature": 0.6,
"topP": 0.7,
"maxOutputTokens": 1024,
},
}
headers = {
"Content-Type": "application/json",
# This endpoint uses API-key auth, not Bearer auth.
"x-goog-api-key": API_KEY,
}
# Gemini-style generateContent uses contents, so messages are mapped into contents.
response = requests.post(URL, headers=headers, json=payload, timeout=30)
response.raise_for_status()
data = response.json()
candidates = data.get("candidates") or [{}]
parts = (candidates[0].get("content") or {}).get("parts") or []
print("".join(part.get("text", "") for part in parts))
const API_KEY = "$SSY_API_KEY";
const MODEL = "anthropic/claude-fable-5";
const url = `https://router.shengsuanyun.com/api/v1beta/models/${MODEL}:generateContent`;
const messages = [
{ role: "user", content: "9.11 和 9.8 哪个数更大?" },
];
async function main() {
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-goog-api-key": API_KEY,
},
body: JSON.stringify({
contents: messages.map((message) => ({
role: message.role,
parts: [{ text: message.content }],
})),
generationConfig: {
temperature: 0.6,
topP: 0.7,
maxOutputTokens: 1024,
},
}),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`Request failed with status ${response.status}: ${text}`);
}
const data = await response.json();
const text = (data.candidates?.[0]?.content?.parts ?? [])
.map((part) => part.text ?? "")
.join("");
console.log(text);
}
main().catch((error) => {
const message = error instanceof Error ? error.message : String(error);
console.error("Request failed:", message);
});
#!/usr/bin/env bash
set -euo pipefail
API_KEY="$SSY_API_KEY"
MODEL='anthropic/claude-fable-5'
BASE_URL="https://router.shengsuanyun.com/api/v1beta/models/${MODEL}:generateContent"
# This endpoint uses API-key auth, not Bearer auth.
curl --fail-with-body --silent --show-error -X POST "${BASE_URL}" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: ${API_KEY}" \
-d '{
"contents": [
{
"role": "user",
"parts": [{"text": "9.11 和 9.8 哪个数更大?"}]
}
],
"generationConfig": {
"temperature": 0.6,
"topP": 0.7,
"maxOutputTokens": 1024
}
}' | python3 -c 'import json,sys
data=json.load(sys.stdin)
candidates=data.get("candidates") or [{}]
parts=(candidates[0].get("content") or {}).get("parts") or []
print("".join(part.get("text", "") for part in parts))'
import requests
API_KEY = "$SSY_API_KEY"
MODEL = "anthropic/claude-fable-5"
URL = f"https://router.shengsuanyun.com/api/v1/models/{MODEL}:generateContent"
messages = [
{"role": "user", "content": "9.11 和 9.8 哪个数更大?"}
]
payload = {
"contents": [
{
"role": message["role"],
"parts": [{"text": message["content"]}],
}
for message in messages
],
"generationConfig": {
"temperature": 0.6,
"topP": 0.7,
"maxOutputTokens": 1024,
},
}
headers = {
"Content-Type": "application/json",
# This endpoint uses API-key auth, not Bearer auth.
"x-goog-api-key": API_KEY,
}
# Gemini-style generateContent uses contents, so messages are mapped into contents.
response = requests.post(URL, headers=headers, json=payload, timeout=30)
response.raise_for_status()
data = response.json()
candidates = data.get("candidates") or [{}]
parts = (candidates[0].get("content") or {}).get("parts") or []
print("".join(part.get("text", "") for part in parts))
const API_KEY = "$SSY_API_KEY";
const MODEL = "anthropic/claude-fable-5";
const url = `https://router.shengsuanyun.com/api/v1/models/${MODEL}:generateContent`;
const messages = [
{ role: "user", content: "9.11 和 9.8 哪个数更大?" },
];
async function main() {
const response = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-goog-api-key": API_KEY,
},
body: JSON.stringify({
contents: messages.map((message) => ({
role: message.role,
parts: [{ text: message.content }],
})),
generationConfig: {
temperature: 0.6,
topP: 0.7,
maxOutputTokens: 1024,
},
}),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`Request failed with status ${response.status}: ${text}`);
}
const data = await response.json();
const text = (data.candidates?.[0]?.content?.parts ?? [])
.map((part) => part.text ?? "")
.join("");
console.log(text);
}
main().catch((error) => {
const message = error instanceof Error ? error.message : String(error);
console.error("Request failed:", message);
});
#!/usr/bin/env bash
set -euo pipefail
API_KEY="$SSY_API_KEY"
MODEL='anthropic/claude-fable-5'
BASE_URL="https://router.shengsuanyun.com/api/v1/models/${MODEL}:generateContent"
# This endpoint uses API-key auth, not Bearer auth.
curl --fail-with-body --silent --show-error -X POST "${BASE_URL}" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: ${API_KEY}" \
-d '{
"contents": [
{
"role": "user",
"parts": [{"text": "9.11 和 9.8 哪个数更大?"}]
}
],
"generationConfig": {
"temperature": 0.6,
"topP": 0.7,
"maxOutputTokens": 1024
}
}' | python3 -c 'import json,sys
data=json.load(sys.stdin)
candidates=data.get("candidates") or [{}]
parts=(candidates[0].get("content") or {}).get("parts") or []
print("".join(part.get("text", "") for part in parts))'
- 公开应用
- 2
- SSY Chatroom公开模型应用
- chatroom_test目标地址未通过链接安全策略