Find Your Marqo API Key
1. Log In (Sign Up) to Marqo Cloud
You must first navigate to Marqo Cloud and either Sign Up (if you haven’t already) or Sign In to your existing Marqo Cloud account.
When doing so, you will be greeted with our Marqo Cloud UI:
2. Navigate to API Keys
You can find the 'API Keys' header on the lefthand side navigation bar. When navigating to the ‘API Keys’ header for the first time, your Marqo Cloud will look like this:
Notice, you have a default API key.
You are welcome to use this API key going forward. Simply press the ‘copy’ icon to the righthand side to copy your API key. You can also press the ‘eye’ icon to view your API key. There is the option to delete the API key too but please take care when doing this.
If you decide you want to create a new API key, you can do as follows.
3. (Optional) Create your own API Key
Click on the ‘+ New API Key’ icon in the top right corner of the ‘API Keys’ section.
After pressing this, you will be prompted to put in your desired API Key name.
Once you are happy with your name, click ‘Create API Key’. This will generate a new key for you that will be visible in the ‘API Keys’ header.
Where do I put my API Key?
You will need to specify your API key when working with Marqo Cloud. Below are examples of using your Marqo API Key to create an index in both cURL
and Python
:
cURL
curl -X POST 'https://api.marqo.ai/api/v2/indexes/my-first-index' \
# SPECIFY API KEY HERE
-H 'x-api-key: XXXXXXXXXXXXXXX' \
-H 'Content-type:application/json' \
-d '
{
"treatUrlsAndPointersAsImages": false,
"model": "hf/e5-base-v2",
"numberOfShards": 1,
"numberOfReplicas": 0,
"inferenceType": "marqo.CPU.large",
"storageClass": "marqo.basic",
"numberOfInferences": 1
}'
Python
import marqo
# SPECIFY API KEY HERE
mq = marqo.Client("https://api.marqo.ai", api_key="XXXXXXXXXXXXXXX")
index_settings = {
"treatUrlsAndPointersAsImages": False,
"model": "hf/e5-base-v2",
"numberOfShards": 1,
"numberOfReplicas": 0,
"inferenceType": "marqo.CPU.large",
"storageClass": "marqo.basic",
"numberOfInferences": 1
}
mq.create_index("my-first-index", settings_dict=index_settings)