将 Dropstone API 与您的套餐配合使用
通过 API 密钥通过 HTTP 调用 Dropstone。该端点与 OpenAI 兼容,按使用量从您的余额中计费,并支持任何语言。涵盖密钥、错误、速率限制以及 API 不包含的内容。
Dropstone API 是一个与 OpenAI 兼容的端点,适用于不应依赖已登录界面的代码:CI 任务、无服务器函数、其他语言的服务。创建密钥,将客户端指向 Dropstone,您就可以像 Chat 和 CLI 一样调用相同的三个模型。
端点参考位于 docs.dropstone.io/cli/api。本页涵盖密钥、计费以及预期内容。
创建 API 密钥
- 在您的 仪表板 中打开 设置。
- 在 API 密钥 下,选择 创建密钥 并为其命名。
- 复制密钥。它看起来像
dsk_live_...,并且只显示一次。
请像对待密码一样对待密钥:切勿提交它,也切勿将其放入浏览器捆绑包中。任何持有它的人都可以花费其背后的余额。您可以在同一页面上查看每个密钥的最后使用时间,并撤销其中任何一个。
计费:按使用量付费
API 密钥请求按使用量从您的余额中计费。套餐配额不适用于这些请求。每周配额属于已登录界面:Chat、CLI 和本地 SDK 会话。API 单独计量,因此管道的流量永远不会消耗您工作的配额,而 Chat 中繁忙的一周也永远不会阻止管道运行。从仪表板中的 计费 充值。
余额为空的密钥会被拒绝,并返回错误说明原因及充值链接,而不是先提供服务再稍后收费。API 没有免费层。
与 OpenAI 兼容
该端点遵循 OpenAI 聊天补全格式,因此大多数现有客户端只需更改基础 URL 和密钥即可使用:
import OpenAI from "openai"
const openai = new OpenAI({
baseURL: "https://api.dropstone.io/api/v1",
apiKey: process.env.DROPSTONE_API_KEY,
})
模型为 dropstone-fast、dropstone-pro 和 dropstone-heavy;请参阅 Dropstone 使用哪些 AI 模型?。指定不带版本的层级会运行当前阵容,因此脚本会自动跟随阵容向前发展。若要固定版本,请使用带版本的形式,例如 dropstone-fast-1.7。模型版本与每月阵容 涵盖了两者。请求适用于任何能够发出 HTTP 调用的语言。
API 不包含的内容
该端点是无状态的,并且有意如此:
- 无记忆。 它不会读取您的账户记忆,其回答也不会被记录在那里。无论您上周教给 Dropstone 什么,相同的输入都会给出相同的答案。
- 无工具且无代理循环。 它只回答聊天补全。读取代码库、编辑文件和运行命令属于 SDK 本地客户端和 CLI。
如果您希望代码使用代理及其记忆,请使用 SDK 的本地客户端。请参阅 每个界面共享同一记忆。
速率限制
请求按 IP 进行速率限制,远高于普通使用水平,以保护服务。触发限制的突发请求会被拒绝,因此请退避并重试,而不是收紧循环。
请求的去向
API 请求在美国处理,与其他所有界面相同。请参阅 您的请求在哪里运行。
组织
组织成员在自己的账户下创建密钥,密钥背后的余额属于密钥所有者。组织管理员可以在组织仪表板上查看成员的 API 使用情况,当账户被停用时(即成员通过 SCIM 被移除时),密钥将停止工作。
Related articles
- Dropstone SDKA typed TypeScript and JavaScript client for the Dropstone agent, with two entry points: one for headless API calls from CI or a serverless function, one that runs the agent locally with the same account memory as the CLI and Chat.
- Install and run your first sessionInstall the Dropstone SDK, make a headless API call with an API key, and run a local agent session that carries your account memory. Includes streaming, structured output, and using the OpenAI SDK against Dropstone.
- One memory across every surfaceThe account memory that follows you across Dropstone Chat, the CLI, and the SDK, what shares it and what does not, and how to keep an integration's learning out of your own memory.
- Which AI models does Dropstone use?Dropstone runs three tiers. On the 1.8 lineup, Fast runs DeepSeek V4.1 Flash, Pro runs GLM-5.3 Flash, and Heavy runs Kimi K3, re-evaluated every month.
- Where your requests runDropstone's servers and the inference providers that run its models are hosted in the United States. Requests are never routed through providers outside the US. What that means for your data.