curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/agent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_name": "code-analyzer",
"agent_inputs": {
"query": "Analyze user engagement data and create visualization plots",
"system_prompt": "Generate comprehensive data analysis with matplotlib/plotly visualizations"
},
"overrides": {}
}'
event: started
data: {"prompt_id": "prompt_123e4567-e89b-12d3-a456-426614174000"}
event: agent
data: {"content": "I'll analyze the user engagement data and create visualization plots.", "type": "reasoning"}
event: tool
data: {"tool_name": "data_analyzer", "content": "Loading dataset with 10,000 records", "status": "started"}
event: tool
data: {"tool_name": "data_analyzer", "content": "Analysis complete. Found key patterns in engagement data.", "status": "completed"}
event: agent
data: {"content": "Analysis shows 65% higher engagement on weekends with peak activity between 2-4 PM.", "type": "response"}
event: tool
data: {"tool_name": "plot_generator", "content": "Generating engagement trend visualization", "status": "started"}
event: committed
data: {"files": ["plots/engagement_trends.png", "analysis/engagement_report.md"], "message": "Add engagement analysis and visualization plots"}
event: build
data: {"event": "start", "output": "Building visualization components..."}
event: build
data: {"event": "pass", "output": "Build completed successfully"}
event: deployed
data: {"status": "success", "url": "https://app.relace.ai/repo/123e4567/viz"}
event: done
data: {"summary": "Successfully analyzed engagement data and generated 2 visualization plots"}
Analysis Agent
Run a data analysis agent on a Relace Repo
POST
/
v1
/
repo
/
{repo_id}
/
agent
curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/agent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_name": "code-analyzer",
"agent_inputs": {
"query": "Analyze user engagement data and create visualization plots",
"system_prompt": "Generate comprehensive data analysis with matplotlib/plotly visualizations"
},
"overrides": {}
}'
event: started
data: {"prompt_id": "prompt_123e4567-e89b-12d3-a456-426614174000"}
event: agent
data: {"content": "I'll analyze the user engagement data and create visualization plots.", "type": "reasoning"}
event: tool
data: {"tool_name": "data_analyzer", "content": "Loading dataset with 10,000 records", "status": "started"}
event: tool
data: {"tool_name": "data_analyzer", "content": "Analysis complete. Found key patterns in engagement data.", "status": "completed"}
event: agent
data: {"content": "Analysis shows 65% higher engagement on weekends with peak activity between 2-4 PM.", "type": "response"}
event: tool
data: {"tool_name": "plot_generator", "content": "Generating engagement trend visualization", "status": "started"}
event: committed
data: {"files": ["plots/engagement_trends.png", "analysis/engagement_report.md"], "message": "Add engagement analysis and visualization plots"}
event: build
data: {"event": "start", "output": "Building visualization components..."}
event: build
data: {"event": "pass", "output": "Build completed successfully"}
event: deployed
data: {"status": "success", "url": "https://app.relace.ai/repo/123e4567/viz"}
event: done
data: {"summary": "Successfully analyzed engagement data and generated 2 visualization plots"}
Path Parameters
Repo ID
Request Body
Name of the predefined agent to run
Response
The agent returns a Server-Sent Events (SSE) stream with real-time updates from tool calls. The various event types indicate different stages of execution.Event Types
Signals that the agent execution has begun
Show properties
Show properties
Unique identifier for this agent execution session
Signals that the agent execution has completed successfully
Show properties
Show properties
Summary of what was accomplished
curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/agent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_name": "code-analyzer",
"agent_inputs": {
"query": "Analyze user engagement data and create visualization plots",
"system_prompt": "Generate comprehensive data analysis with matplotlib/plotly visualizations"
},
"overrides": {}
}'
event: started
data: {"prompt_id": "prompt_123e4567-e89b-12d3-a456-426614174000"}
event: agent
data: {"content": "I'll analyze the user engagement data and create visualization plots.", "type": "reasoning"}
event: tool
data: {"tool_name": "data_analyzer", "content": "Loading dataset with 10,000 records", "status": "started"}
event: tool
data: {"tool_name": "data_analyzer", "content": "Analysis complete. Found key patterns in engagement data.", "status": "completed"}
event: agent
data: {"content": "Analysis shows 65% higher engagement on weekends with peak activity between 2-4 PM.", "type": "response"}
event: tool
data: {"tool_name": "plot_generator", "content": "Generating engagement trend visualization", "status": "started"}
event: committed
data: {"files": ["plots/engagement_trends.png", "analysis/engagement_report.md"], "message": "Add engagement analysis and visualization plots"}
event: build
data: {"event": "start", "output": "Building visualization components..."}
event: build
data: {"event": "pass", "output": "Build completed successfully"}
event: deployed
data: {"status": "success", "url": "https://app.relace.ai/repo/123e4567/viz"}
event: done
data: {"summary": "Successfully analyzed engagement data and generated 2 visualization plots"}
⌘I