How to connect OpenAI and Mergado Sources#
Connecting OpenAI to the Mergado Sources extension lets you use advanced GPT language models for automated editing and generation of texts directly in your product feed in the project in Mergado Editor.
OpenAI API pricing and limits#
Using the OpenAI API is paid and charged based on the number of processed tokens (units of text, where approximately 1,000 tokens correspond to 750 words). Charges apply to both input data (your prompt) and output text.
These charges are paid directly to the provider (OpenAI) — payment does not go through Mergado Sources, which is free. Using your own API key means you pay OpenAI directly without any intermediary mark-ups. Billing is visible directly in the OpenAI admin.
In the API access admin in OpenAI, in the Usage section, you can set spending limits (billing limits) to keep costs under control and avoid spending more than planned.
Processing speed of OpenAI API requests can vary throughout the day and may sometimes be significantly slower. If data does not appear immediately after regeneration, regenerate the project again after some time.
If you want to know (roughly) how many tokens your prompt will consume, use the OpenAI Tokenizer service. It is a web page where you paste your prompt and the Tokenizer calculates how many tokens it found. Remember, however, that the final OpenAI cost is calculated from both input tokens (your prompt) and output tokens (the response from OpenAI).
How to create a connection with OpenAI?#
1. Activating the extension#
Activate Mergado Sources in Mergado Store: I want to activate → select the project you want to work with → Enable.
2. Getting an API key from OpenAI#
- Sign in to your account at OpenAI, or create one if you do not have one yet.
- In the top right corner, click the settings icon.
- In the left menu, click the API Keys section.
- Click Create new secret key, name the key, create it by clicking Create secret key, and then copy it.
3. Setting up in Mergado Sources#
- Open the Mergado Sources interface and go to the Data sources tab.
- Next to the OpenAI source, click the Set up button.
- Paste the copied API key into the Token field and click Save connection.
- If everything is in order, the connection status will change to green with the message Connection is active.
FAQ#
What do I need to connect OpenAI to Mergado Sources?#
You need an account on the OpenAI platform from which you get an API key, and the Mergado Sources extension activated for the relevant project in Mergado Editor.
Is the OpenAI connection free?#
The Mergado Sources extension itself is free, but using the OpenAI API is paid. Charges are calculated by the number of processed tokens and you pay them directly to OpenAI. Mergado Sources does not take any part in these payments.
What are tokens and how is their price calculated?#
A token is a unit of text — approximately 1,000 tokens correspond to 750 words. Charges apply to both the input text (your prompt) and the output text (the response from GPT). You can check the approximate number of tokens in your prompt using the OpenAI Tokenizer tool.
How do I set a spending limit to avoid exceeding my budget?#
In the OpenAI admin, go to the Usage section and set a spending limit (billing limits). This ensures the API stops responding once your set limit is reached, so you do not spend more than planned.
Why do I pay OpenAI directly rather than through Mergado?#
Using your own API key ensures maximum transparency — you see exactly how much you are paying and for what, directly in your OpenAI account. There are no hidden mark-ups from a payment intermediary.
Where do I find the API key in OpenAI?#
Sign in at platform.openai.com, click the settings icon in the top right corner, and in the left menu go to API Keys. Create a new key with the Create new secret key button, name it, and copy it.
How do I know the connection to OpenAI is working?#
On the Data sources tab in the Mergado Sources interface, you will see a green “Connection is active” status next to the OpenAI source.
Why didn’t data appear right after regeneration?#
There may be several reasons. First, the project needs to be regenerated at least twice — on the first regeneration Mergado Sources loads the data, on the second it writes it. Second, OpenAI API processing speed can vary significantly throughout the day. If data is still missing, regenerate the project again after some time.
Can I limit text generation to just a subset of products?#
Yes. When creating an element, you select a specific product query from Mergado Editor — for example, only products where the description is missing. This saves OpenAI API costs, as only relevant products are processed.