curl --request POST \
--url https://api.beamstudio.ai/agent-graphs/complete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'current-workspace-id: <current-workspace-id>' \
--data '
{
"agentName": "Bitcoin Price Agent",
"nodes": [
{
"id": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"objective": "Fetch the current Bitcoin price and return it to the user in a friendly format",
"evaluationCriteria": [
"The response contains a valid price number",
"The price is greater than 0"
],
"isEntryNode": true,
"isExitNode": false,
"xCoordinate": 116,
"yCoordinate": 150,
"isEvaluationEnabled": false,
"isAttachmentDataPulledIn": true,
"onError": "STOP",
"autoRetryWhenAccuracyLessThan": 80,
"autoRetryLimitWhenAccuracyIsLow": 1,
"autoRetryCountWhenFailure": 1,
"autoRetryWaitTimeWhenFailureInMs": 1000,
"enableAutoRetryWhenAccuracyIsLow": false,
"enableAutoRetryWhenFailure": false,
"childEdges": [
{
"sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
"condition": "price > 50000",
"name": "Success Path",
"isAttachmentDataPulledIn": true
}
],
"parentEdges": [
{
"sourceAgentGraphNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"targetAgentGraphNodeId": "22b6aa40-7d7c-449f-b151-0229834b48ba",
"condition": "price > 50000",
"name": "Success Path",
"isAttachmentDataPulledIn": true
}
],
"toolConfiguration": {
"toolFunctionName": "GPTAction_Custom_BitcoinPriceFetcher_xjUR",
"toolName": "Bitcoin Price Fetcher",
"description": "Fetches the current Bitcoin price from CoinGecko API and returns the USD value",
"requiresConsent": false,
"isMemoryTool": false,
"memoryLookupInstruction": "",
"isBackgroundTool": false,
"isBatchExecutionEnabled": false,
"isCodeExecutionEnabled": false,
"inputParams": [
{
"fillType": "ai_fill",
"position": 0,
"required": true,
"dataType": "string",
"reloadProps": false,
"remoteOptions": false,
"paramName": "api_url",
"paramDescription": "The URL of the API endpoint to call",
"question": "What API endpoint URL should be used?",
"linkedOutputParamNodeId": "d2cbeb35-9110-426c-967a-c0dba38289a9",
"linkedOutputParamName": "bitcoin_price_usd",
"staticValue": "https://api.example.com/data",
"outputExample": "https://api.coingecko.com/api/v3/simple/price",
"options": [
{
"label": "United States",
"value": "US"
}
],
"paramTip": "Make sure to include the full URL with protocol (https://)"
}
],
"outputParams": [
{
"isArray": false,
"paramName": "bitcoin_price_usd",
"position": 0,
"paramDescription": "The current price of Bitcoin in USD, extracted from the API response",
"dataType": "number",
"parentId": null,
"paramPath": "data.bitcoin.usd",
"outputExample": "94523.50",
"typeOptions": {
"format": "currency",
"precision": 2
}
}
],
"iconSrc": null,
"accuracyScore": null,
"preferredModel": "gpt-4o",
"prompt": "You are a helpful assistant. Given the input parameters, fetch the current Bitcoin price and return it in a user-friendly format."
}
}
],
"agentDescription": "An AI agent that fetches real-time cryptocurrency prices and provides market insights",
"settings": {
"prompts": [
"What is the current Bitcoin price?",
"Can you fetch the latest cryptocurrency rates?"
],
"agentPersonality": "You are a friendly financial assistant who explains complex topics in simple terms",
"agentRestrictions": "Do not provide investment advice. Only provide factual price information."
}
}
'