Skip to content

Quickstart

This takes about five minutes. You need an OpexAIO account in a workspace with an Enterprise plan on at least one product (the API is an Enterprise feature), and a terminal with curl (and jq to read the answers more easily).

1. Create an API key

  1. Sign in at app.aio.opexcg.com.
  2. In the sidebar, open MCP.
  3. Choose Create API key, give it a label such as Reporting script, and choose Create.
  4. Copy the key. It starts with pk_live_ and is shown only once.

The key acts as you, in the workspace you were in when you created it. Treat it like a password: keep it out of source code and revoke it on the same page if it leaks.

2. Set two variables

Terminal window
export OPEX=https://app.aio.opexcg.com
export OPEX_API_KEY=pk_live_your_key_here

Every example in these docs uses them. To try things on staging first, use https://staging.app.aio.opexcg.com with a key created there.

3. Check who you are

Terminal window
curl -s "$OPEX/api/me" -H "X-API-Key: $OPEX_API_KEY" \
| jq '{userId, role, tenantName, email, entitlements, permissions: (.permissions | length)}'
{
"userId": "usr-dewi-lestari",
"role": "admin",
"tenantName": "Nusantara Digital",
"email": "[email protected]",
"entitlements": ["timesheets", "helpdesk", "pmo", "crm", "expenses", "leave"],
"permissions": 118
}

entitlements are the products your workspace can use, and permissions the actions your roles allow. Authentication and permissions explains both.

4. Read some data

Terminal window
curl -s "$OPEX/api/projects?pageSize=2" -H "X-API-Key: $OPEX_API_KEY" \
| jq '{total, page, pageSize, items: [.items[] | {id, name, status}]}'
{
"total": 21,
"page": 1,
"pageSize": 2,
"items": [
{ "id": "prj-epicor", "name": "ABC Epicor ERP", "status": "active" },
{ "id": "prj-opexmx", "name": "ABC OPEXmx Portal", "status": "active" }
]
}

5. See what an error looks like

Without a key:

Terminal window
curl -s -w ' %{http_code}\n' "$OPEX/api/me"
{"error":"unauthorized"} 401

Errors always carry a machine-readable code. Conventions lists how to handle them.

Next