Run Your First Agent
Now that you have an agent created, let's run it! You'll send a message to your agent and see the AI response in real-time.
How Agent Runs Work
When you "run" an agent, here's what happens behind the scenes:
- Your input message is sent to the Fluxgate API
- ACP creates a "run" record to track the execution
- The Celery runtime worker picks up the job
- Your agent's system prompt + your message are sent to the AI model
- If the agent has tools, the AI can call them during execution
- The response, token usage, cost, and timing are recorded
- You get back the complete result
Method 1: Run via Dashboard
Go to the Agents Tab
Open http://localhost:3000/dashboard and click 'Agents' in the sidebar.
Find Your Agent
Locate the agent you created (e.g., 'my-first-agent') in the list.
Click 'Run' or 'Chat'
Click the run button next to your agent. This opens the execution panel where you can type a message.
Type Your Message
Enter something like: 'How do I reset my password?' and press Enter or click Send.
View the Response
Watch the AI response stream in. You'll also see token usage, cost, and latency in the run details.
Method 2: Run via API
# Replace AGENT_ID with the ID from the previous step
curl -X POST http://localhost:8000/api/v1/agents/AGENT_ID/run \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "How do I reset my password?",
"parameters": {
"temperature": 0.7,
"max_tokens": 1000
}
}'Understanding the Run Response
{
"id": "run_xyz789",
"agent_id": "agt_abc123def456",
"status": "completed",
"input": "How do I reset my password?",
"output": "To reset your password, follow these steps:\n1. Go to the login page\n2. Click 'Forgot Password'\n3. Enter your email address\n4. Check your email for a reset link\n5. Click the link and enter your new password",
"tokens_used": 245,
"cost_usd": 0.0012,
"latency_ms": 1850,
"model": "gpt-4o",
"steps": [
{
"type": "llm_call",
"model": "gpt-4o",
"tokens": 245,
"duration_ms": 1850
}
],
"created_at": "2024-01-15T10:35:00Z"
}Run Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| input | string | - | The user message to send to the agent |
| temperature | number | 0.7 | Controls randomness (0 = deterministic, 1 = creative) |
| max_tokens | number | 2000 | Maximum tokens in the response |
| stream | boolean | false | Enable real-time streaming of the response |
| context | object | {} | Additional context variables passed to the agent |
Check Run Status
Runs are asynchronous. If the status is "running", poll until it's "completed":
# Check the status of a run
curl http://localhost:8000/api/v1/agents/AGENT_ID/runs/RUN_ID \
-H "Authorization: Bearer YOUR_API_KEY"View Run History
See all runs for an agent, including their status, cost, and timing:
# List all runs for an agent
curl http://localhost:8000/api/v1/agents/AGENT_ID/runs \
-H "Authorization: Bearer YOUR_API_KEY"Monitor in the Dashboard
The Dashboard Overview tab shows all agent runs in real-time with metrics like total cost, average latency, success rates, and error counts. Great for keeping an eye on your agents!
Next Steps
Your agent is running! Next, take a tour of the dashboard to see all 24 feature tabs and what they can do.