1. Get Your API Key
- Subscribe to Rose Labs at roselabs.ai
- Navigate to Settings > API Keys
- Copy your API key
2. Create an Agent
curl -X POST "https://navi-j9a9.onrender.com/api/agents" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"goal": "Find the current price of Bitcoin and Ethereum",
"model": "rose-1-lite"
}'
import requests
response = requests.post(
"https://navi-j9a9.onrender.com/api/agents",
headers={
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY"
},
json={
"goal": "Find the current price of Bitcoin and Ethereum",
"model": "rose-1-lite"
}
)
agent = response.json()
print(f"Agent ID: {agent['agent_id']}")
const response = await fetch(
"https://navi-j9a9.onrender.com/api/agents",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY"
},
body: JSON.stringify({
goal: "Find the current price of Bitcoin and Ethereum",
model: "rose-1-lite"
})
}
);
const agent = await response.json();
console.log(`Agent ID: ${agent.agent_id}`);
Response
{
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"goal": "Find the current price of Bitcoin and Ethereum",
"model": "rose-1-lite",
"status": "ACTIVE",
"progress": 0,
"created_at": "2024-01-15T10:30:00Z"
}
3. Poll for Results
Agents work asynchronously. Poll the status endpoint to check progress and retrieve messages.curl "https://navi-j9a9.onrender.com/api/agents/550e8400-e29b-41d4-a716-446655440000" \
-H "x-api-key: YOUR_API_KEY"
import time
agent_id = "550e8400-e29b-41d4-a716-446655440000"
while True:
response = requests.get(
f"https://navi-j9a9.onrender.com/api/agents/{agent_id}",
headers={"x-api-key": "YOUR_API_KEY"}
)
status = response.json()
print(f"Status: {status['agent']['status']}, Progress: {status['agent']['progress']:.0%}")
if status["agent"]["status"] in ["COMPLETED", "FAILED"]:
break
time.sleep(2)
# Print final messages
for msg in status["messages"]:
print(f"[{msg['role']}] {msg['text'][:200]}")
const agentId = "550e8400-e29b-41d4-a716-446655440000";
const pollAgent = async () => {
while (true) {
const response = await fetch(
`https://navi-j9a9.onrender.com/api/agents/${agentId}`,
{ headers: { "x-api-key": "YOUR_API_KEY" } }
);
const status = await response.json();
console.log(`Status: ${status.agent.status}, Progress: ${Math.round(status.agent.progress * 100)}%`);
if (["COMPLETED", "FAILED"].includes(status.agent.status)) {
return status;
}
await new Promise(r => setTimeout(r, 2000));
}
};
const result = await pollAgent();
result.messages.forEach(msg => console.log(`[${msg.role}] ${msg.text}`));
Response
{
"agent": {
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "COMPLETED",
"progress": 1.0,
"token_count": 1520,
"message_count": 4
},
"messages": [
{
"role": "USER",
"text": "Find the current price of Bitcoin and Ethereum"
},
{
"role": "ASSISTANT",
"text": "I'll search for the current cryptocurrency prices..."
},
{
"role": "ASSISTANT",
"text": "Current prices:\n- Bitcoin: $97,432\n- Ethereum: $3,891"
}
]
}
4. Choose Your Model
| Model | Best For | Cost |
|---|---|---|
rose-1-lite | Fast tasks, simple research | Lower cost |
rose-1-ultra | Complex reasoning, detailed analysis | Higher quality |
Next Steps
- Authentication - API key management
- Agents API - Full API reference (pause, resume, delete)
- Error Handling - Handle errors gracefully