API tutorials

Authentication

Authenticate the manifest, claim, and response workflow with a PAT and tenant/workspace context.

For an existing BenchDX or RobustDX evaluation, read the trace manifest, claim one prompt at a time, call your target model, then submit each answer. These external API requests use an AIDX Personal Access Token (PAT).

Create a PAT

Personal account and Organization account

After signing in, select Personal account or the intended organization, then select the evaluation's workspace before creating or choosing a PAT. Both account types use Personal Access Tokens; the name PAT does not mean the token works only with Personal accounts.

Request contextPersonal accountOrganization account
PATCreated in the Personal account contextCreated in that organization context
X-Tenant-IdOmit this headerRequired: use the organization's tenant ID from Request Tutorial
X-Workspace-IdRequired: the evaluation's personal workspaceRequired: the evaluation's organization workspace
Evaluation and trace IDsFrom the selected Personal account evaluationFrom the selected organization evaluation
Endpoints and request bodiesSame manifest, claim, and response formatsSame manifest, claim, and response formats
Personal account headersHTTP
Authorization: Bearer <PERSONAL_ACCOUNT_PAT>
X-Workspace-Id: <PERSONAL_WORKSPACE_ID>
Personal account: read a manifestcURL
curl --request GET \
  'https://trial.aidx.pro/api/evaluation/trace-manifests/123' \
  --header 'Authorization: Bearer <PERSONAL_ACCOUNT_PAT>' \
  --header 'X-Workspace-Id: <PERSONAL_WORKSPACE_ID>'
Organization account: use its PAT, tenant, workspace, and evaluationcURL
curl --request GET \
  'https://trial.aidx.pro/api/evaluation/trace-manifests/123' \
  --header 'Authorization: Bearer <ORGANIZATION_ACCOUNT_PAT>' \
  --header 'X-Tenant-Id: <ORGANIZATION_TENANT_ID>' \
  --header 'X-Workspace-Id: <ORGANIZATION_WORKSPACE_ID>'

Account switching in the browser does not switch a script's context. Change the PAT, tenant header, workspace ID, and evaluation ID together. For a Personal request, remove any previous organization's tenant header. The same sign-in email or API host does not make PATs interchangeable across accounts.

There is no accountType or organizationId field to add to these API bodies. A tenant header is a routing hint, not permission: organization membership, workspace access, and evaluation ownership remain enforced. Omitting the tenant header for an Organization account can cause 401.

Send authentication and routing headers

Organization account headersHTTP
Authorization: Bearer <ORGANIZATION_ACCOUNT_PAT>
X-Tenant-Id: <ORGANIZATION_TENANT_ID>
X-Workspace-Id: <ORGANIZATION_WORKSPACE_ID>
HeaderRequirement
AuthorizationRequired. Bearer followed by the AIDX PAT.
X-Workspace-IdRequired on every request in this tutorial. Use the evaluation's workspace ID.
X-Tenant-IdRequired for an Organization account. Omit it for a Personal account.

The tenant header selects the store where the PAT is verified. Workspace membership, account status, module permissions, and evaluation ownership still apply. A valid PAT alone does not grant access to another user's evaluation.

These PAT requests do not require a JWT login or a CSRF cookie. Keep the same headers when following pagination links and making POST requests.

Find your endpoint and identifiers

Open Request Tutorial for the evaluation to copy its API origin, evaluation ID, and workspace ID. For an Organization account, also copy its tenant ID. Examples use https://trial.aidx.pro; replace it with the origin shown for your environment.

evaluationId
A positive integer, such as 123. Use the same ID in the manifest path, claim JSON, and response form. The claim body requires a JSON number, not a quoted number or a UUID.
traceId
The UUID returned by the manifest. Copy it unchanged into the claim and response requests; order is not a trace ID.
Tenant and workspace
Send these IDs in the routing headers. The claim JSON accepts only evaluationId and traceId.

Protect and revoke tokens

  • Load PATs from environment variables or a secret store.
  • Keep tokens out of source control, browser code, screenshots, and logs.
  • Replace expired tokens; delete a PAT on the Personal Access Token page to revoke it.
  • Use trusted HTTPS origins. Validate pagination URLs before forwarding authentication headers.