# Using the FabriXAI API to Interact with Your AI Agent
This step-by-step guide walks you through the process of cloning an AI agent on FabriXAI and making your first API call using the FabriXAI API with cURL. We'll use the Resource Allocation Planner (opens new window) as an example AI Agent throughout the tutorial.
There are 5 key steps to follow:
- Sign Up for a FabriXAI Account
- Clone the Agent Template
- Create an API Key
- Enable API Access
- Make an API Call Using cURL
Let’s get started!
# Step 1: Sign Up for a FabriXAI Account
To use FabriXAI, you'll first need an account. If you already have one, feel free to skip ahead to Step 2: Clone the Agent Template.
- Go to the Resource Allocation Planner detail page (opens new window).
- Click "Clone this Agent" button.
- Click "Sign up".
- Fill in your account details and click "Sign Up".
- Check your email inbox for a verification message and click the link inside.
- Review your email address and Click "Next" to proceed.
- Wait a moment while your workspace is being set up. Once it's ready, you'll receive a welcome email.
- Click the link in the email to access your workspace.
# Step 2: Clone the Agent Template
Let’s start working with the Resource Allocation Planner agent.
- In your FabriXAI workspace, go to the Templates section from the sidebar.
- Search for "Resource Allocation Planner".
- Hover over the template and click "Clone to Edit".
- Click "Create" to finalize and add it to your workspace.
# Step 3: Create an API Key
To use the API, you need an API key.
- Navigate to the AI Agent Builder for the agent you cloned.
- Go to Integrations > API in the left sidebar.
- Click "API Key", then choose "Create New API Key".
- Copy and store your API key somewhere safe.
Please ensure that you store your API key in a secure location and do not share it with anyone to prevent unauthorized access.
# Step 4: Enable API Access
Before using the API, make sure it’s enabled (And usually it is already on):
- Navigate to the AI Agent Builder for the specific AI agent you wish to integrate.
- Click on "Integrations > API" in the left sidebar.
- In the Backend Service API card, make sure the toggle in the top-right corner is switched ON.
# Step 5: Make an API Call Using cURL
Now let’s send a request to your AI agent using cURL from your command line.
- Open a Command Prompt (Windows) or Terminal (Mac/Linux).
- Copy and paste the example cURL command below:
The following command is for Resource Allocation Planner (opens new window). For other AI agents, you may need to update the properties in "inputs" based on the configured inputs of the AI agent.
curl -X POST 'https://console.fabrixai.com/v1/completion-messages' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{
"inputs": {
"key_skills_expertise": "Communication, Customer service",
"project_name": "Demo Project"
},
"response_mode": "blocking",
"user": "user"
}'
- Replace
{api_key}
with your generated API key from Step 3. - Hit Enter to run the command. After a moment, you'll see a response from the AI.
- Here is a sample response:
{ "event": "message", "task_id": "84d20e75-d834-4f56-8b30-99f435bd8fef", "id": "f3d9242a-2e48-4e90-97aa-984d089f5340", "message_id": "dfbb5d22-9b7c-43cd-aa23-ce36caf57e42", "mode": "completion", "answer": "\n\nTo develop a comprehensive resource allocation plan for Demo Project, I will analyze the project's requirements and identify the necessary human, financial, and technological resources. Here's a detailed plan:\n\n**Project Requirements:**\n\n* Communication: Develop a communication strategy to engage with stakeholders, including customers, team members, and project sponsors.\n* Customer Service: Provide exceptional customer service to ensure customer satisfaction and loyalty.\n\n**Human Resources:**\n\n* Project Manager: 1 person, responsible for overseeing the project and ensuring its successful completion.\n* Communication Specialist: 1 person, responsible for developing and implementing the communication strategy.\n* Customer Service Representative: 2 people, responsible for providing customer service and support.\n* Team Members: 4 people, responsible for completing project tasks and delivering project deliverables.\n\n**Financial Resources:**\n\n* Project Budget: $200,000, allocated for project expenses, including personnel costs, training, and technology.\n* Personnel Costs: $150,000, allocated for salaries, benefits, and training for team members.\n* Technology Costs: $20,000, allocated for software, hardware, and other technology expenses.\n* Miscellaneous Costs: $30,000, allocated for project-related expenses, including travel, meetings, and marketing.\n\n**Technological Resources:**\n\n* Project Management Software: Asana or Trello, used for project planning, tracking, and collaboration.\n* Customer Relationship Management (CRM) Software: Salesforce or HubSpot, used for managing customer interactions and data.\n* Communication Tools: Email, phone, and video conferencing software, used for team communication and stakeholder engagement.\n\n**Timeline for Acquiring and Deploying Resources:**\n\n* Week 1-2: Hire Project Manager and Communication Specialist.\n* Week 3-4: Hire Customer Service Representatives and Team Members.\n* Week 5-6: Train team members on project management software, CRM software, and communication tools.\n* Week 7-8: Deploy project management software, CRM software, and communication tools.\n* Week 9-10: Develop and implement communication strategy and customer service plan.\n\n**Optimizing Resource Utilization:**\n\n* Implement cross-training for team members to ensure they have the necessary skills to complete project tasks.\n* Leverage external partnerships with customer service providers or communication specialists to supplement team resources.\n* Encourage team members to share knowledge and best practices to improve project efficiency and effectiveness.\n\n**Monitoring and Adjusting the Resource Allocation Plan:**\n\n* Regularly review project progress and adjust the resource allocation plan as needed.\n* Monitor project expenses and adjust the budget as necessary.\n* Conduct regular team meetings to ensure team members are aware of project requirements and can provide feedback on resource utilization.\n* Establish a process for escalating issues or concerns to the Project Manager or stakeholders.\n\n**Recommendations for Adjusting the Resource Allocation Plan:**\n\n* If project progress is behind schedule, consider hiring additional team members or outsourcing tasks to external providers.\n* If project expenses are exceeding budget, consider reducing personnel costs or negotiating with vendors for better rates.\n* If team members are struggling with project tasks, consider providing additional training or support to ensure they have the necessary skills to complete tasks effectively.\n\nBy following this comprehensive resource allocation plan, Demo Project can ensure that it has the necessary human, financial, and technological resources to deliver project deliverables on time, within budget, and to the required quality standards.", "metadata": { "usage": { "prompt_tokens": 125, "prompt_unit_price": "0", "prompt_price_unit": "0", "prompt_price": "0E-7", "completion_tokens": 679, "completion_unit_price": "0", "completion_price_unit": "0", "completion_price": "0E-7", "total_tokens": 804, "total_price": "0E-7", "currency": "USD", "latency": 8.433709602977615 } }, "created_at": 1741657635 }