cURL Examples
Quick cURL examples for testing the PrompTick API.
Execute Agent
curl -X POST https://api.promptick.ai/api/v1/agents/agent_abc123/execute \
-H "Authorization: Bearer pk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"variables": {
"product_name": "Smart Watch Pro",
"target_audience": "fitness enthusiasts"
}
}'
Response (202 Accepted):
{
"success": true,
"executionId": "550e8400-e29b-41d4-a716-446655440000",
"agentId": "agent_abc123",
"agentName": "Product Description Generator",
"status": "processing",
"message": "Agent execution started",
"statusUrl": "/api/v1/agents/agent_abc123/executions/550e8400-e29b-41d4-a716-446655440000"
}
Check Execution Status
curl https://api.promptick.ai/api/v1/agents/agent_abc123/executions/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer pk_live_YOUR_API_KEY"
Response (completed):
{
"executionId": "550e8400-e29b-41d4-a716-446655440000",
"agentId": "agent_abc123",
"status": "completed",
"percentage": 100,
"currentStep": "Processing",
"output": "Generated content here...",
"tokensUsed": 450,
"costUSD": 0.000045,
"latencyMs": 1250,
"executedAt": "2025-01-15T10:30:06Z"
}
With jq for Pretty Output
curl -X POST https://api.promptick.ai/api/v1/agents/agent_abc123/execute \
-H "Authorization: Bearer pk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"variables": {"product_name": "Test"}}' \
| jq '.'
Save Response to File
curl -X POST https://api.promptick.ai/api/v1/agents/agent_abc123/execute \
-H "Authorization: Bearer pk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d @request.json \
-o response.json
Where request.json:
{
"variables": {
"product_name": "Smart Watch Pro"
}
}