On this page

Get started

Quickstart

This quickstart takes you from nothing to one successful call to Wexa, in Python, TypeScript or REST.

You need a Wexa project and an administrator role on it, so that you can create a key. Python needs 3.9 or later and TypeScript needs Node 18 or later; REST needs only curl.

How it works

  1. You create an API key, pinned to one project.
  2. The client sends the key as a bearer token to https://fabric.wexa.ai.
  3. Wexa reads your scope from the key and returns the result.

Step 1: Get an API key

In the console, pick your project in the project switcher, open Settings → Developer access, choose the API keys tab and click Create key. A Simple-only role sees Generate API key in Simple mode instead. Copy the secret when it is shown, because it is never shown again.

Then export the key and the workspace URL. Both SDKs read these two names. WEXA_WORKSPACE is the host URL, not a project id: the key is pinned to your project, so you never pass one.

export WEXA_WORKSPACE="https://fabric.wexa.ai"
export WEXA_API_KEY="fab_sk_..."

To create a key over REST instead, or to see which roles can, read Authentication.

Step 2: Install

REST has nothing to install, so go straight to step 3.

npm install @wexa-fabric/sdk

Step 3: Make one call

The docs tool is registered in every deployment and needs no data in your project. It returns your own scope and limits, so a success proves the key and its scope together.

curl -sS -X POST https://fabric.wexa.ai/v1/docs \
  -H "Authorization: Bearer $WEXA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"topic": "governance"}'
{
  "lifecycle_id": "qlc_...",
  "result": {
    "mode": "auto",
    "quota": {
      "org_window_max": 600,
      "org_window_used": 7,
      "project_window_max": 120,
      "project_window_used": 7
    }
  }
}

That is a successful call. mode is your project mode, where auto is Simple mode, and quota is your rolling call budget for the project and the organization.

The SDKs return the result directly. REST wraps it in an envelope with a lifecycle_id, which names the governance record of the call.

If it fails:

  • 401, AuthError in Python: no key was sent (missing bearer credential), or it is wrong or revoked (api key invalid or revoked). Create a new key; see Authentication.
  • token invalid: the key does not start with fab_sk_, so it is not an API key. Copy the secret again; see Authentication.
  • ConfigurationError in Python: WEXA_WORKSPACE or WEXA_API_KEY is not set in this shell. Export both from step 1; see Authentication.

What's next