AI Currency Converter
Difficulty Level
Nodes
Tags
Try out this flow yourself at Lamatic.ai. Sign up for free and start building your own AI workflows.
Add to LamaticThis guide will help you build an AI Currency Converter that fetches real-time INR to USD exchange rates. The system processes user input, retrieves live exchange rate data, and provides an accurate conversion. By implementing this tool in Lamatic, youâll learn how to integrate AI with external APIs for seamless and up-to-date currency conversion.
What Youâll Build
A simple API that processes user input, fetches real-time INR to USD exchange rates, and provides accurate currency conversion. This API ensures seamless and up-to-date exchange rate retrieval, enabling efficient and precise currency conversion for various financial applications.
Getting Started
1. Tool Creation
- Sign up at Lamatic.ai and log in.
- Navigate to Flows > Tools.
- Click on Add Tool.
Define Tool Details
- Add Tool name: convertINRtoUSD
- Add Description: Convert amount from Indian Rupees (INR) to US Dollars (USD)
Configure Parameters
- Add Parameter name âamountâ and define the datatype as a string
This is a JSON Schema object that describes the parameters that the tool accepts and are the ones that will be passed to the model.
{
"amount": {
"type": "number",
"required": true,
"description": "Amount in INR to convert"}
}- In the Code section
const response = await fetch('https://api.exchangerate-api.com/v4/latest/INR');
const data = await response.json();
const usdRate = data.rates.USD;
const result = input.amount * usdRate;
console.log('result', result)
output = result-
âinputâ and âoutputâ are reserved variables. Avoid overwriting them.
-
To access variables defined in the schema, use âinput.variableNameâ.
-
Assign the return value to âoutputâ pass data from the function.
- You can test the JavaScript Code by providing parameters and clicking on the Test button.

- Finally, Click on the Create Button.
1. Project Setup
- Sign up at Lamatic.ai and log in.
- Navigate to the Projects and click New Project or select your desired project.
- Youâll see different sections like Flows, Context, and Connections

2. Creating a New Flow
- Navigate to Flows, select New Flow.
- Click Create from scratch as starting point.

4. Setting Up Your API
- Click âChoose a Triggerâ.
- Select âAPI Requestâ under the interface options.

- Configure your API:
- Add your Input Schema
- Set amount as parameter in input schema
- Set response type to âReal-timeâ

5. Adding AI Text Generation
- Click the + icon to add a new node.
- Choose âGenerate textâ.

- Configure the AI model:
- Select your âOpen AIâ credentials
- Choose âgpt-4-turboâ as your Model
- Click on â+â under Prompts section.
- Set up your prompt:
Convert {{triggerNode_1.output.Amount}} INR to USD.
Give the output in decimals.
- You can add variables using the âAdd Variableâ button

- Add the tool you created under Tools section
- Select the desired tools. You can add multiple tools as needed.
6. Configuring the response
- Click the API response node.

- Add Output Variables by clicking the + icon.
- Select variable from your Generate Text Node.
7. Test the flow
- Click on âAPI Requestâ trigger node.
- Click on Configure test.

- Fill sample value in âAmountâ and click on test.
8. Deployment
- Click the Deploy button.

- Your API is now ready to be integrated into Node.js or Python applications.
- Your flow will run on Lamaticâs global edge network for fast, scalable performance.
9. Whatâs Next?
- Experiment with different prompts
- Try other AI models
- Add more processing steps to your flow
- Integrate the API into your applications
10. Tips
- Save your tests for reuse across different scenarios
- Use consistent JSON structures for better maintainability
- Test thoroughly before deployment
Now you have a working AI-powered API! You can expand on this foundation to build more complex applications using Lamatic.aiâs features.