Documentation
REST API
Use the REST API when you are outside the JavaScript SDK: your own backend jobs, internal automations, partner agents, Python scripts, CI, or any language with an HTTP client.
Base URLs
https://auth.ductai.vercel.apphttps://api.ductai.vercel.app/v1Authenticate
Pick the credential that matches who is calling. Both paths hit the same /invoke and /message endpoints.
Shell token — company backend and internal automations
A shell token proves the caller is the company that owns the shell. Use this for jobs you run on your own servers. Never share sk_duct_… with external parties.
curl -X POST https://auth.ductai.vercel.app/v1/shell-token \
Response: { "shell_token": "st_...", "expires_in": 3600 }. Store DUCT_SECRET_KEY in env vars only on the server side.
Agent access profile — partner and external agents
Create a named profile in Dashboard → Shell → Agent setup. External callers pass shellId + unique profile slug — nothing secret.
curl -X POST https://auth.ductai.vercel.app/v1/agent-access-token \
Invoke An Action
curl -X POST https://api.ductai.vercel.app/v1/shells/shell_acme_prod/invoke \
Ask A Natural-Language Question
Callers send a message to /message and Duct routes it to text, a tool call, or a clarification. Both agent_token and shell_token are accepted. Use shell_token for your own backend; use agent_token for partner agents that should not hold your root secret.
# Company backend (shell token)Python client — shell token (company backend)
import osPython client — agent token (partner / external agent)
import osJavaScript client — agent token (partner / external agent)
async function getAgentToken(shellId, profile) {
User Consent Token
For actions tied to a real user, pass a delegated user token in X-Duct-User-Consent. This is separate from the shell token and represents the user's authorization.
Do not expose secrets
Shell secret keys and user-token generation must stay server-side. Browser code should only call your own backend.Search the Capability Network
Find shells that expose a matching capability across the Duct network. Use this before making a cross-shell call.
curl -X POST https://api.ductai.vercel.app/v1/registry/search \ -H "Content-Type: application/json" \ -d '{"query": "trigger refund", "side_effects": true, "limit": 5}'
Cross-Shell Action
Call an action on another public shell directly from your shell. See the Inter-Shell Protocol docs for gate checks and the consent matrix.
curl -X POST https://api.ductai.vercel.app/v1/intershell/message \