模型 SDK

开箱即用的模型:LLM、视觉、语音转写、实时转写,以及调度模型 Jev。不用自己去各家申请 key、不用自己记账——每次调用都记在调用方所属公司的账上(开发者 Key 记它的公司;Nexus 应用的访客用量记应用所属公司)。

import { model } from "/developer/sdk/v1/aidc.js";

目录

模型 类型 输入 适合
deepseek-flash LLM 文本 翻译、摘要、抽取、分类——最快最省(默认关闭思考)
gpt-5.4-mini LLM 文本、图片 结构化输出、轻量看图
gpt-5.5 LLM 文本、图片 复杂分析、长文写作(不对公开应用开放)
gpt-6-luna 视觉 文本、图片 看图判断:质检、识别、读表
gpt-transcribe 语音 音频 文件转写,自带标点与语种识别,按秒计量
gpt-4o-mini-transcribe 语音 音频 更省的文件转写
gpt-live-transcribe 实时语音 音频流 边说边出字(见 语音 SDK)
jev-latest 调度 文本 在给定选项里快速分类 / 路由,只选不写

实时目录(含上游是否可用):GET /api/v1/models,或 aidc models。

对话

const reply = await model.text({ model: "deepseek-flash", messages: [{ role: "user", content: "用一句话介绍 AIDC" }] });

for await (const delta of model.stream({ model: "gpt-5.4-mini", messages })) output.textContent += delta;

const data = await model.json({
  model: "gpt-5.4-mini",
  messages,
  schema: { name: "invoice", schema: { type: "object", properties: { total: { type: "number" } }, required: ["total"], additionalProperties: false } },
});

图片输入:content: [{ type: "text", text: "…" }, await model.image(blob)]。

转写

const { text } = await model.transcribe(audioBlob, { model: "gpt-transcribe", language: "zh" });

Jev

const answers = await model.decide("客户问:发票什么时候开?", {
  route: { instructions: "这条消息应该交给谁处理?", criteria: { finance: "开票、付款、报销", sales: "报价、合同", support: "使用问题" } },
});
// → { route: { choice: "finance", confidence: 0.93, probabilities: {…} } }

用任何 OpenAI SDK

模型 API 是 OpenAI 兼容的——改 base_url 即可:

from openai import OpenAI
client = OpenAI(base_url="https://www.ai-dc.ai/api/v1/models", api_key=os.environ["AIDC_API_KEY"])
client.chat.completions.create(model="gpt-6-luna", messages=[...])
client.audio.transcriptions.create(model="gpt-transcribe", file=open("a.webm", "rb"))

支持的字段:model、messages(文本 / image_url)、stream、temperature、top_p、max_tokens / max_completion_tokens、reasoning_effort、response_format(json_object / json_schema)。其余字段会被忽略、不转发。

计费与额度

命令行

aidc models
aidc model chat -m deepseek-flash "把这段话翻成日语:…"
aidc model chat -m gpt-6-luna "图里有几个人?" --image photo.jpg
aidc model decide --state "发票什么时候开" --question route=交给谁 --choice route:finance=财务 --choice route:sales=销售

本页由 developer/docs/model.md 生成 · Markdown 原文 · llms.txt