Check that your API fits
A custom API works when the API:- uses one static secret on every request: an API key in a header, a bearer token, or basic auth
- is served over HTTPS from one base domain
- takes JSON or file upload (multipart) request bodies
Create a custom API
1
Open the form
In the sidebar’s Workspace tab, choose Connections under Manage. Open the Advanced tab and click Add Custom API next to Custom APIs.
2
Fill in the details
3
Save
Click Create Custom API. You’re back on the Advanced tab, with the new custom API in the list.
/v1/customers. Without a domain, every call has to use a full URL.
Duet Agents sends the credential like this:
How Duet Agents protects the credential
- Duet Agents encrypts the credential and never shows it again after you save it.
- Duet Agents adds the credential to each request on its servers. Coworkers, app code and the browser never see it.
- When a credential is attached, calls must use HTTPS.
- Calls to private or internal network addresses, such as
localhostor10.x.x.x, are blocked. - Duet Agents removes the credential from error responses before showing them.
Add documentation
Coworkers and the app editor’s AI read a custom API’s Documentation before they call it. You’ll see “Retrieved custom API documentation” in the chat. The better the docs, the fewer wrong guesses about endpoints and fields.- Free text: paste the parts of the API docs that matter, with example requests and responses.
- OpenAPI: paste the OpenAPI spec as JSON or YAML, then click Validate OpenAPI. You’ll see “OpenAPI spec is valid”, or a list of OpenAPI Validation Issues to fix.
Who can use a custom API
The Scope decides which apps can call the API:- Organization (all apps): every app in your organization. These are also the only custom APIs that AI coworkers can use.
- Specific Apps: only the apps you selected. Coworkers can’t use these; they show “Restricted to specific apps” in a coworker’s access list.
Use a custom API in chat
Call our billing API and list the invoices that failed in the last 7 days.
Look up customer 4821 in the Acme API and tell me their plan.Each call appears as a step such as “Called GET /v1/invoices”. In the coworker’s activity history, calls appear as “Called custom API”. A call times out after 30 seconds, or 120 seconds when it uploads files.
Use a custom API in apps
The AI in the app editor writes the code. It calls the custom API through Duet Agents’s helpers, which add the credential for you:callCustomApi from @/client-lib/custom-api-client the same way. App code never reads the key from environment variables or sets the auth header itself. See Working with code.
Edit or delete a custom API
Custom APIs are listed under Custom APIs on the Advanced tab of Connections, with their Type, Domain and Scope. The search box at the top of the page filters them too. To edit one, click the pencil icon (Edit) next to it. On Edit Custom API:- You can change the type, name, API key header, domain, scope, description and documentation.
- “Auth type can’t be changed after creation.” To switch auth type, create a new custom API and delete the old one.
- To replace the credential, fill in the credential fields. “Leave all credential fields blank to keep the current values, or fill them all in to replace them.”
App connections
One Duet Agents app can call another app’s API through an app connection. The coworker you ask must have access to both apps. In Duet Agents chat or Slack, ask for example:Show the tasks from our To-Do List app in Project Tracker.The coworker works out which endpoints of the other app it needs, then asks you to approve. In Duet Agents, a Let app call other app card lists the Allowed endpoints and warns that it “Creates an API token for other app in your name. Anyone who uses or edits app can call these other app endpoints as you.” Click Approve connection or Decline. In Slack, the coworker posts a card with the same buttons. A Slack request expires after 24 hours. When you approve, Duet Agents creates a custom API that only the calling app can use, with the token stored like any other credential. The app calls it from its server code. Approving again for the same two apps updates the allowed endpoints of the existing connection. The app connection shows up under Custom APIs. You can change its name, description and documentation, but not its domain, header, scope, apps or credential. Delete it to revoke the token. Calls only work once the other app is published.

