Compound API
Build on Compound
The Compound REST API gives your software the same agents your analysts use. Create an agent for each of your users, send it files and questions, and stream back its work as it happens.
What the API can do
Everything the Compound CLI does is available over HTTPS, with the same permissions and the same results.
Agents
Create as many agents as you need, tag each with your own external ID, and list, update or delete them.
Messages and live events
Send an agent a message and stream its replies, task updates, proposals and each operation it runs as server-sent events.
Tasks and proposals
Track the tasks an agent is working on and approve or reject the changes it proposes.
Files
Upload source documents, download the Excel, Word, PowerPoint and PDF files an agent produces, and read their version history.
Sharing and projects
Share an agent's drive with people on your team and group related work into projects.
Schedules
Run an agent on a schedule, such as a weekly portfolio update or a morning news summary.
Inbox and comments
Read an agent's inbox and the comment threads people leave on its files.
Company follow lists
Choose the public companies an agent follows so it picks up their filings and news.
Usage
Read your plan's credits and what you spent on each agent.
Your first request
Three calls cover the core loop: create an agent for one of your users, send it a message, and stream its progress.
1. Export the API key we issued to your organization, in place of the placeholder.
export COMPOUND_API_KEY="<your-api-key>"2. Create an agent and tag it with the ID your system uses for that user.
AGENT_ID=$(curl -X POST https://ws.getcompound.ai/v1/agents \ -H "Authorization: Bearer $COMPOUND_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"Research agent","external_id":"user-4821"}' | jq -r .id)3. Send the agent a message.
curl -X POST https://ws.getcompound.ai/v1/agents/$AGENT_ID/messages \ -H "Authorization: Bearer $COMPOUND_API_KEY" \ -H "Content-Type: application/json" \ -d '{"text":"Summarize the latest 10-K and build a three-statement model."}'4. Stream the agent's events as it works.
curl -N https://ws.getcompound.ai/v1/agents/$AGENT_ID/events \ -H "Authorization: Bearer $COMPOUND_API_KEY"
How access works
API access is not self-serve. We set up each organization with our team so the account, billing and limits fit how you will use it.
01
Book a demo
Tell us what you want to build and how many people or systems will call the API.
02
We activate your organization
Our team creates an API account for your team or company and agrees limits and billing with you.
03
You receive API keys
We issue keys for your organization. Send them in the Authorization header as a Bearer token.
API keys belong to your organization, not to a person. One key can create an agent for every user in your company, and the keys keep working when people join or leave.
Security
Keys stored hashed
We store only a hash of each key. The full key is shown once, when it is issued.
Revocable at any time
Ask us to revoke a key and every request that uses it is rejected right away. Issue a new key before you rotate.
Rate limited
Each organization has request limits, so one runaway script cannot slow down your other work.
Your data stays yours
An API key reaches only its own organization's agents and files. The same security controls as the Compound app apply.
OpenAPI specification
The spec describes every endpoint and works with any OpenAPI tool or client generator.
Frequently asked questions
No. Book a demo and our team activates an API account for your organization, then issues its keys.
As many as your organization needs. A common setup is one agent per person in your company, all created with the same organization key.
Pass an external ID when you create an agent and filter by it when you list agents. Compound stores the value and never interprets it.
The CLI is built on the same API, so anything you can do from the CLI you can do over HTTPS. People can keep signing in to the CLI with their own Compound account.
Open the events stream for an agent. It first sends a snapshot of the agent's state, then a server-sent event for each new message, task change, proposal and operation. Reconnect with the last cursor you read to pick up where you left off.
API usage draws on your organization's Compound credits. We agree pricing and limits with you when we activate your account.
Talk to us about the API
Tell us what you want to build. We will set up your organization and get you keys.