How to Set Up OpenAI & xAI APIs on MQL5 – Other – 30 March 2025

Steps to Set Up OpenAI and Grok APIs for Gold Fighter MT5

Initial step is to go into MT5, press Ctrl + O, and fill in the information as shown in the image: 

Then press OK.

Steps to Set Up OpenAI API for Gold Fighter MT5

This guide will walk you through how to obtain and set up your OpenAI API key for use with OpenAI Gold Fighter MT5.

This is a separate service from the web version of ChatGPT (ChatGPT Plus / Pro) and does not require you to subscribe to a paid ChatGPT plan.

Instead, you can use the API features by funding your OpenAI account with a minimum of $5. The following steps are explained with reference to screenshots.

Step 1: Create an OpenAI account from the link below.

If you already have an account, you can skip this step.

 

You can create and delete multiple API keys here. However, note that if you close the page after creating a key once, you will not be able to view the same key again.

You can issue new keys as many times as you like for free, so if you lose your key, you can recreate it. Next, click on the “Create new secret key” button.

Step 3: Fill in a name (any name you want).

Step 4: Click “Create secret key”.

Step 5: Click “Copy” (Please note that once you close it, you will not be able to view it again.). You should store it in a secret place and not let anyone else know. If you lose it, it’s okay, you can just delete it and create a new one, you can do this countless times. 

Step 6: Paste the key into the input field of EA Gold Fighter MT5 labeled “OpenAI API Key”. This will allow the EA to communicate with OpenAI’s API.

 

Step 7: Go to the link below to add a payment method as you need to spend a minimum of $5 to use the OpenAI API.

 

Steps to Set Up Grok API for Gold Fighter MT5

Step 2: Click “Start Building”.

Step 3: Sign up if you don’t have an account, otherwise log in.

Step 4: Click “Authorize app”.

 

Step 5: Click “Continue”.

Step 6: Click “Setup billing”. 

Step 7: Click “Enable”.

Step 8: Click “Purchase credits” (you need to spend a minimum of $5-$10 to use the Grok API key). 

Step 9: Click “Complete billing profile”.

Step 10: Fill in your information and click “Save billing Address”, then pay to purchase the API. 

Step 11: Click on the “API keys” tab (your API management page). 

Step 12: Click “Create API key”.

Step 13: Fill in a name for the API key. 

Step 14: Click “Save”.

Step 15: Copy.

Step 16: Paste the API key into the input field of Gold Fighter MT5. 

Important Notes

  • Purchasing the Grok and OpenAI APIs is like renting a powerful service on demand. You pay to use its capabilities each time you need them, and the cost will depend on the amount of resources you consume (number of requests, number of tokens, etc.). This cost is separate from the paid plans of Grok or OpenAI. 
  • You can check the usage status of the OpenAI API here: https://platform.openai.com/settings/organization/usage
  • You can check the usage status of the Grok API here: https://console.x.ai/team/default/billing/credits

Now we are ready to use the OpenAI API and Grok API in Gold Fighter MT5. If you have any questions, please contact the community and support.

Leave a Comment