API
Quickstart
Send a message with curl, JavaScript, or Python.
Embed an agent you already run, such as a Receptionist or a Garage front desk. Text, images, video, files, projects, and phone use one key. What you do not tick, the key cannot do.
1. Create a key
Settings, then API keys. Choose all agents or tick the ones this key may use. Tick capabilities, or everything. Set the request limit and, if you want one, a monthly credit cap. Copy the key. It is shown once.
2. Send a message
Send the key as a bearer token. Do not paste a real key into source you commit. Use an environment variable.
curl -s https://hawkeye.brownhawke.engineering/api/partner/v1/messages \
-H "Authorization: Bearer $HAWKEYE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"agent_id":"receptionist","message":{"role":"user","content":"A customer is asking about an MOT tomorrow."}}'const res = await fetch(process.env.HAWKEYE_HOST + "/api/partner/v1/messages", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.HAWKEYE_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
agent_id: "receptionist",
conversation_id: conversationId,
message: { role: "user", content: "Do you have a slot on Thursday?" },
}),
});
const data = await res.json();import os, requests
r = requests.post(
os.environ["HAWKEYE_HOST"] + "/api/partner/v1/messages",
headers={"Authorization": "Bearer " + os.environ["HAWKEYE_API_KEY"]},
json={
"agent_id": "garage-front-desk",
"message": {"role": "user", "content": "Is the Golf ready?"},
},
timeout=60,
)
r.raise_for_status()
print(r.json()["message"]["content"])A successful body has ok, conversation_id, agent_id, message (id, role, content, created), and credits. Send the next message with that conversation id.
3. Stream, or attach a file
POST the same JSON to /api/partner/v1/messages/stream for server-sent events. The first event is start, then delta, then done. See Streaming and Attachments.
4. Phone
Calls are enabled on this server. Continue at Phone.