# List your agents
curl -s https://www.skydive.com/api/v2/agents \
-H "Authorization: Bearer $SKYDIVE_API_KEY" | jq
# Send a message
curl -s https://www.skydive.com/api/v1/chat/send \
-H "Authorization: Bearer $SKYDIVE_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"agentId\": \"$AGENT_ID\",
\"conversationId\": null,
\"content\": \"Hey! In one sentence, what do you do?\"
}" | jq// List your agents
const agents = await fetch(`${BASE_URL}/api/v2/agents`, {
headers: { Authorization: `Bearer ${process.env.SKYDIVE_API_KEY}` },
}).then((r) => r.json());
// Send a message
const reply = await fetch(`${BASE_URL}/api/v1/chat/send`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SKYDIVE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
agentId: agents[0].id,
conversationId: null, // null starts a new conversation
content: "Hey! In one sentence, what do you do?",
}),
}).then((r) => r.json());# List your agents
agents = requests.get(
f"{BASE_URL}/api/v2/agents",
headers={"Authorization": f"Bearer {os.environ['SKYDIVE_API_KEY']}"},
).json()
# Send a message
reply = requests.post(
f"{BASE_URL}/api/v1/chat/send",
headers={"Authorization": f"Bearer {os.environ['SKYDIVE_API_KEY']}"},
json={
"agentId": agents[0]["id"],
"conversationId": None,
"content": "Hey! In one sentence, what do you do?",
},
).json()