搭配你的方案使用 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.