Find and Manage Your Marqo API Keys
1. Log In to Marqo Cloud
You must first navigate to Marqo Cloud and 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 with 'admin' scope.
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.
3. Understanding API Key Scopes
Marqo now supports scoped API keys, so you can control exactly what each key can do.
Scope | Description | Example Use Case |
---|---|---|
🛠️ Admin | Full control — create, modify, and delete indexes. | Managing infrastructure, automation scripts |
✏️ Read-Write | Add, update, or delete documents. Cannot create or delete indexes. | Indexing or updating data |
🔍 Read | Read-only access — can search, fetch, and view documents. | Searching or fetching data |
Note: Scoped API keys are being rolled out gradually.
If you don't yet see the scope options (Admin, Read-Write, Read) in your Marqo Cloud account, please contact support and we’ll enable them for you.
If you decide you want to create a new API key, you can do as follows.
4. (Optional) Create your own API Key with Desired Scope
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 and scope.
Once you are happy with your API key name and scope, 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)