Skip to content
Context docs
Build

Evals quickstart

Create a key, make your first HTTP request and run your first CLI command.

This quickstart takes about five minutes. You create a task API key, list your datasets over HTTP, then install the CLI and do the same from the command line.

You need Evals turned on for your deployment, and Evals access in the app. Until your deployment turns Evals on, the Evals pages don’t appear in the app. Organization owners and admins have access by default, and an admin can grant it to other roles: Open Evals on the Member role, in Settings > Organization > Roles.

  1. Create a task API key

    Create a task API key with only Read evals checked, as API keys describes. Store it in an environment variable, never in your code or in a repository:

    TerminalCode
    export CONTEXT_API_KEY="<task-api-key>"
  2. Set your deployment’s address

    Your deployment is the Context address your organization signs in to, such as https://api.context.ai. Set it without a trailing slash:

    TerminalCode
    export CONTEXT_APP_ORIGIN="https://api.context.ai"
  3. Find your workspace ID

    Datasets and evaluations belong to a workspace. In the app, open the workspace’s menu, choose Workspace settings, and copy the Workspace ID field on the General tab:

    TerminalCode
    export WORKSPACE_ID="<workspace-id>"
  4. List your datasets over HTTP

    curl -sS --fail-with-body --get "$CONTEXT_APP_ORIGIN/api/v1/evals/datasets" \ -H "Authorization: Bearer $CONTEXT_API_KEY" \ --data-urlencode 'workspaceScope={"kind":"one","workspaceId":"'"$WORKSPACE_ID"'"}'

    The TypeScript example uses top-level await, so run it as an ES module (a .mts file, or a package with "type": "module").

    workspaceScope is JSON in one query value; let your HTTP library URL-encode it. Without it, an organization owner or admin gets datasets from every workspace. If your Evals access covers exactly one workspace, you get that one; otherwise the server answers 403 and asks you to name a workspace.

    A 401 means the key is missing or isn’t a task API key. A 403 means the key lacks evals:read, you don’t have Evals access, the key is limited to specific agents, or you didn’t name a workspace. The body’s error says which, and only the missing-capability 403 carries a code; see Errors.

  5. Install the CLI

    In the app, open Settings > Terminal. It shows the install command for your operating system, built from your deployment’s address. On macOS and Linux it has this form:

    TerminalCode
    curl -fsSL "$CONTEXT_APP_ORIGIN/install.sh" | bash

    This installs the Context command-line tools, including the context command these pages use. Windows users copy the command that Settings > Terminal shows for Windows.

    The CLI’s help and error messages still write context-cli; type context instead.

  6. Set your organization ID

    The CLI also needs your organization ID. Copy it from the Organization ID field in your organization’s Settings > General:

    TerminalCode
    export CONTEXT_ORG_ID="<org-id>"
  7. List your datasets from the CLI

    TerminalCode
    context evals datasets list --workspace "$WORKSPACE_ID"

    The command prints one JSON document: a page with items and nextCursor. The CLI’s list commands page their results, while the HTTP list of datasets returns a plain array. Without --workspace, an organization owner or admin gets every workspace, and anyone whose Evals access covers exactly one workspace gets that one; anyone else gets exit code 2 and is asked to name one. Organization owners and admins can also pass --workspace all.

Next steps