1. 创建 API Key
注册或登录 IteraCompute,然后在控制台创建 API Key。
读取会议记录,调用 Auto,保存有用的摘要。从完整 Python 项目开始,再将下方 SDK 配置用于自己的应用。
注册或登录 IteraCompute,然后在控制台创建 API Key。
Python 使用 base_url,JavaScript 使用 baseURL,然后调用 Chat Completions。
使用准确的 API Model ID,启用智能体或视觉功能前确认上下文与模型能力。
将 API Key 保存在服务端环境或工具凭据存储中;需要手动填写密钥的字段请使用自己的 API Key。
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.iteracompute.com/v1",
api_key=os.environ["ITERACOMPUTE_API_KEY"],
)
response = client.chat.completions.create(
model="Auto",
messages=[{"role": "user", "content": "Hello!"}],
max_tokens=512,
)
text = response.choices[0].message.content
if not text or not text.strip():
raise RuntimeError("Empty model reply: activation is incomplete.")
print(text)import OpenAI from "openai";
if (!process.env.ITERACOMPUTE_API_KEY) {
throw new Error("Set ITERACOMPUTE_API_KEY on the server.");
}
const client = new OpenAI({
baseURL: "https://api.iteracompute.com/v1",
apiKey: process.env.ITERACOMPUTE_API_KEY,
});
const response = await client.chat.completions.create({
model: "Auto",
messages: [{ role: "user", content: "Hello!" }],
max_tokens: 512,
});
const text = response.choices[0].message.content;
if (!text || !text.trim()) throw new Error("Empty model reply: activation is incomplete.");
console.log(text);读取一份简短的 UTF-8 会议记录,调用 Auto,将三条摘要保存到 summary.txt。完整 Python 命令行项目包含环境准备和错误处理。
一份包含发布日期、负责人、延期事项和阻塞条件的摘要文件。
退出码为 0,summary.txt 非空且与打印的摘要一致,并逐项核对原文事实。
On October 14, the team agreed to launch the customer feedback dashboard on October 21.
Maya owns the release checklist and will finish it by October 18.
Leo will add CSV export before the launch. A mobile layout is deferred to the next release.
The launch is blocked until the export tests pass and the support guide is reviewed.• Customer feedback dashboard launch decision: go live on October 21, but the launch is blocked until CSV export tests pass and the support guide is reviewed.
• Maya owns the release checklist and must finish it by October 18; Leo will add CSV export before launch.
• Mobile layout is deferred to the next release.
Saved: summary.txt以下为示例输出,实际措辞可能不同。API 回复为空时,不创建或覆盖输出文件。
# Bash / zsh / WSL; set ITERACOMPUTE_API_KEY in your environment first.
curl --fail-with-body https://api.iteracompute.com/v1/chat/completions \
-H "Authorization: Bearer $ITERACOMPUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"Auto","messages":[{"role":"user","content":"Reply with exactly: Hello!"}],"max_tokens":512}'确认 choices[0].message.content 包含可见文本;HTTP 200 本身不够。推理可能消耗输出预算。Auto 可使用首次 Auto 调用示例,再在工具中发送提示。
能力表示 IteraCompute 接口的支持情况。工作流程中的可用性也取决于工具与配置,推理参数因模型而异。
Python 使用 base_url,JavaScript 使用 baseURL。显式传入 IteraCompute 密钥,SDK 默认读取的环境变量并非 ITERACOMPUTE_API_KEY。
上方纯文本示例调用 client.chat.completions.create,读取 choices[0].message.content。Responses 示例与 response.output_text 属于另一套 API。
测试文本输出时,请检查响应中有可见文本,并确认申请的输出长度符合模型要求。
请在用量页查看 Auto 可用额度。只有主动开启按量付费后才会扣除钱包余额。
请确认密钥允许调用 Auto,并检查是否有套餐额度、活动赠额或已开启按量付费。