> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vijil.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Register an Agent, run a behavioral Evaluation, and inspect the results through the CLI, SDK, REST API, or MCP.

This quickstart takes you from authentication to a completed behavioral Evaluation. Choose one interface and follow its tab through each step.

| Interface | Best For | Requirements |
| - | - | - |
| **CLI** | Terminal workflows and CI/CD | `vijil-sdk`; Python 3.11–3.13 |
| **SDK** | Python applications and notebooks | `vijil-sdk`; Python 3.11–3.13 |
| **REST API** | Custom integrations and non-Python applications | An HTTP client and a bearer token |
| **MCP** | Natural-language workflows in Claude Code | `vijil-mcp`; Python 3.10+ |

> [!NOTE]
>
> The [`vijil-mcp`](https://pypi.org/project/vijil-mcp/) server is a separate package that uses `vijil-console` under the hood. Install it separately from `vijil-sdk`, since the SDK can reuse saved MCP sign-in credentials and gateway settings.

> [!TIP]
>
> To work on an Agent in its own repository, install the [Claude Code plugin](https://docs.vijil.ai/developer-guide/getting-started/claude-code-plugin.md) instead. It bundles `vijil-mcp` and adds `/vijil` commands for the whole lifecycle.

## Prerequisites

* A [Vijil Console deployment](https://docs.vijil.ai/developer-guide/deploy-vijil/deploy-vijil-console.md), its API gateway URL, and access to a team
* Vijil credentials: a client ID and client secret, or a bearer access token
* A provider API key for the Agent endpoint you want to test
* [Claude Code](https://claude.ai/code) if you choose MCP. See [Claude Code setup](https://docs.vijil.ai/developer-guide/getting-started/claude-code-plugin.md#before-you-begin).

## Run Your First Evaluation

**1. Install Your Interface**

> [tab] CLI
>
> Install `vijil-sdk`, which includes the `vijil` CLI:
>
> ```bash theme={null}
> python -m pip install vijil-sdk
> vijil --help
> ```

> [tab] SDK
>
> Install the Python SDK:
>
> ```bash pip theme={null}
> python -m pip install vijil-sdk
> ```
>
> ```bash Poetry theme={null}
> poetry add vijil-sdk
> ```
>
> Verify the import:
>
> ```bash theme={null}
> python -c "from vijil import Vijil; print('ok')"
> ```

> [tab] REST API
>
> No Vijil package is required. Save the API gateway URL for the following requests:
>
> ```bash theme={null}
> export VIJIL_URL="https://console-api.example.com"
> ```

> [tab] MCP
>
> Install the standalone MCP server:
>
> ```bash pip theme={null}
> python -m pip install vijil-mcp
> ```
>
> ```bash pipx theme={null}
> pipx install vijil-mcp
> ```
>
> Verify the server is available:
>
> ```bash theme={null}
> vijil-mcp --help
> ```

**2. Configure and Authenticate**

> [tab] CLI
>
> Save the Console gateway, then export the API credential pair created in the Console:
>
> ```bash theme={null}
> vijil config set gateway.url https://console-api.example.com
> export VIJIL_CLIENT_ID="vk_..."
> export VIJIL_CLIENT_SECRET="..."
> vijil auth status
> ```
>
> The CLI exchanges the pair for a bearer token when it creates the client. If you already have a bearer token, set `VIJIL_API_KEY` or run `vijil auth login` and paste the token. Interactive login saves it to `~/.vijil/credentials.json`.
>
> If your credentials do not resolve a team automatically, pin one in `~/.vijil/config.toml`:
>
> ```bash theme={null}
> vijil config set defaults.team_id <team-id>
> ```

> [tab] SDK
>
> Export a [Console API credential pair](https://docs.vijil.ai/developer-guide/sdk/setup.md#authentication) and construct the client:
>
> ```bash theme={null}
> export VIJIL_CLIENT_ID="vk_..."
> export VIJIL_CLIENT_SECRET="..."
> ```
>
> ```python theme={null}
> from vijil import Vijil
>
> client = Vijil(gateway="https://console-api.example.com")
> ```
>
> `Vijil()` reads the credential pair from the environment and exchanges it for a bearer token. You can instead provide an existing bearer token through `VIJIL_API_KEY` or `Vijil(api_key="<access-token>")`.
>
> Use credentials for the team that owns your Agent. `client.team_id` shows the team the SDK resolves to.

> [tab] REST API
>
> Exchange your Console email and password for a bearer token:
>
> ```bash theme={null}
> curl -s -X POST "$VIJIL_URL/v1/auth/jwt/login" \
>   -H "Content-Type: application/json" \
>   -d '{"email": "user@example.com", "password": "your-password"}'
> ```
>
> Copy the response's `access_token`, then list your team memberships and save the team you want to use:
>
> ```bash theme={null}
> export TOKEN="eyJhbG..."
>
> curl -s "$VIJIL_URL/v1/users/me/teams" \
>   -H "Authorization: Bearer $TOKEN"
>
> export TEAM_ID="c58aea71-..."
> ```

> [tab] MCP
>
> Configure the `vijil-console` dependency installed with the MCP server:
>
> ```bash theme={null}
> vijil-console auth init --url https://console-api.example.com
> vijil-console auth login
> vijil-console team use <team-id>
> ```
>
> Create `.mcp.json` in your project root:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "vijil": {
>       "type": "stdio",
>       "command": "vijil-mcp"
>     }
>   }
> }
> ```
>
> Start Claude Code from that directory so it can discover the server and its tools.

**3. Register an Agent**

The example below registers an OpenAI-compatible chat-completions endpoint. Read provider credentials from environment variables in your application code and keep them out of source control.

> [tab] CLI
>
> ```bash theme={null}
> export OPENAI_API_KEY="sk-..."
>
> vijil agents create \
>   --name "My Chat Agent" \
>   --model "gpt-4o" \
>   --url "https://api.openai.com/v1/chat/completions" \
>   --api-key-env OPENAI_API_KEY \
>   --protocol chat_completions
> ```
>
> Copy the returned Agent `id`, then confirm the Agent is available:
>
> ```bash theme={null}
> export AGENT_ID="a1b2c3d4-..."
> vijil agents list
> ```

> [tab] SDK
>
> Set the provider API key before running the registration code:
>
> ```bash theme={null}
> export OPENAI_API_KEY="<provider-api-key>"
> ```
>
> ```python theme={null}
> import os
>
> agent = client.agents.create(
>     name="My Chat Agent",
>     url="https://api.openai.com/v1/chat/completions",
>     model_name="gpt-4o",
>     api_key=os.environ["OPENAI_API_KEY"],
>     protocol="chat_completions",
> )
>
> print(agent.id, agent.agent_name)
> ```

> [tab] REST API
>
> ```bash theme={null}
> export OPENAI_API_KEY="sk-..."
>
> curl -s -X POST "$VIJIL_URL/v1/agent-configurations/" \
>   -H "Authorization: Bearer $TOKEN" \
>   -H "Content-Type: application/json" \
>   -d "{
>     \"agent_name\": \"My Chat Agent\",
>     \"model_name\": \"gpt-4o\",
>     \"agent_url\": \"https://api.openai.com/v1/chat/completions\",
>     \"api_key\": \"$OPENAI_API_KEY\",
>     \"protocol\": \"chat_completions\"
>   }"
> ```
>
> Copy the returned Agent `id` and use its `team_id` for the remaining requests:
>
> ```bash theme={null}
> export AGENT_ID="a1b2c3d4-..."
> export TEAM_ID="<agent-team-id>"
> ```

> [tab] MCP
>
> Ask Claude Code to register the endpoint. Do not paste provider secrets into the prompt; provide them only through the credential mechanism supported by your Agent configuration.
>
> Register an Agent named My Chat Agent that uses gpt-4o through the OpenAI chat-completions endpoint, and show me the resulting Agent ID.
>
> Register an Agent named My Chat Agent that uses gpt-4o through the OpenAI chat-completions endpoint, and show me the resulting Agent ID.

**4. Run a Baseline Evaluation**

A baseline Evaluation uses the standard reliability, security, and safety [Harnesses](https://docs.vijil.ai/concepts/evaluation-components/harness.md). The sample size limits how many [Probes](https://docs.vijil.ai/concepts/evaluation-components/probe.md) Vijil selects from each Harness.

> [tab] CLI
>
> ```bash theme={null}
> vijil evaluate "$AGENT_ID" --baseline --sample-size 50
> ```
>
> The command waits by default, prints progress, and returns the completed Evaluation. Copy its `id`:
>
> ```bash theme={null}
> export EVAL_ID="e5f6a7b8-..."
> ```

> [tab] SDK
>
> ```python theme={null}
> evaluation = client.evaluate(
>     agent.id,
>     baseline=True,
>     sample_size=50,
> )
>
> print(evaluation.id, evaluation.status)
> ```
>
> `client.evaluate()` polls every five seconds by default and returns the persisted Evaluation summary after the run reaches a terminal state.

> [tab] REST API
>
> Start the asynchronous Evaluation:
>
> ```bash theme={null}
> curl -s -X POST "$VIJIL_URL/v1/evaluations/" \
>   -H "Authorization: Bearer $TOKEN" \
>   -H "Content-Type: application/json" \
>   -d "{
>     \"agent_id\": \"$AGENT_ID\",
>     \"team_id\": \"$TEAM_ID\",
>     \"harness_names\": [\"reliability\", \"security\", \"safety\"],
>     \"sample_size\": 50
>   }"
> ```
>
> Save the returned `evaluation_id`, then repeat the status request until the Evaluation reaches a [terminal state](https://docs.vijil.ai/developer-guide/evaluate/running-evaluations.md#check-status):
>
> ```bash theme={null}
> export EVAL_ID="e5f6a7b8-..."
>
> curl -s "$VIJIL_URL/v1/evaluations/$EVAL_ID" \
>   -H "Authorization: Bearer $TOKEN"
> ```

> [tab] MCP
>
> Run a behavioral Evaluation for Agent a1b2c3d4-… with the reliability, security, and safety Harnesses, sample 50 Probes per Harness, wait for completion, and show me the Evaluation ID.
>
> Run a behavioral Evaluation for Agent a1b2c3d4-… with the reliability, security, and safety Harnesses, sample 50 Probes per Harness, wait for completion, and show me the Evaluation ID.

**5. Inspect the Results**

Continue after the Evaluation succeeds. If it ends as `failed` or `cancelled`, inspect its status and error details before retrieving results.

> [tab] CLI
>
> Show the completed Evaluation and the Agent's latest [Trust Score](https://docs.vijil.ai/concepts/trust-score/introduction.md):
>
> ```bash theme={null}
> vijil evaluations show "$EVAL_ID"
> vijil scores show "$AGENT_ID"
> ```
>
> Inspect only the prompt-response rows from failed Probes:
>
> ```bash theme={null}
> vijil evaluations responses "$EVAL_ID" --status failed
> ```

> [tab] SDK
>
> Read the overall and per-dimension scores from the returned Evaluation:
>
> ```python theme={null}
> print(evaluation.trust_score)
>
> if evaluation.dimensions is not None:
>     print(evaluation.dimensions.reliability)
>     print(evaluation.dimensions.security)
>     print(evaluation.dimensions.safety)
> ```
>
> The SDK returns scores on a 0.0–1.0 scale. The Console displays them on a 0–100 scale.
>
> Retrieve the complete nested results or only failed prompt-response rows:
>
> ```python theme={null}
> results = client.scores.results(evaluation.id)
> failures = client.evaluations.responses(
>     evaluation.id,
>     status="failed",
> )
> ```

> [tab] REST API
>
> Retrieve the persisted score summary and the complete nested results:
>
> ```bash theme={null}
> curl -s "$VIJIL_URL/v1/evaluation-summaries/$EVAL_ID?team_id=$TEAM_ID" \
>   -H "Authorization: Bearer $TOKEN"
>
> curl -s "$VIJIL_URL/v1/evaluation-results/$EVAL_ID/results?team_id=$TEAM_ID" \
>   -H "Authorization: Bearer $TOKEN"
> ```

> [tab] MCP
>
> Show the Trust Score, dimension scores, and failed Probe responses for Evaluation e5f6a7b8-…
>
> Show the Trust Score, dimension scores, and failed Probe responses for Evaluation e5f6a7b8-…

**6. Download the Report**

You generate Trust Reports on demand after Evaluations complete.

> [tab] CLI
>
> `reports download` generates the report first when necessary:
>
> ```bash theme={null}
> vijil reports download "$EVAL_ID" --path .
> ```

> [tab] SDK
>
> `client.reports.download()` also generates a missing report before retrying the download:
>
> ```python theme={null}
> pdf_bytes = client.reports.download(evaluation.id)
>
> with open("report.pdf", "wb") as report_file:
>     report_file.write(pdf_bytes)
> ```

> [tab] REST API
>
> Generate the report, then download its PDF:
>
> ```bash theme={null}
> curl -s -X POST \
>   "$VIJIL_URL/v1/evaluations/$EVAL_ID/report?team_id=$TEAM_ID" \
>   -H "Authorization: Bearer $TOKEN"
>
> curl -s \
>   "$VIJIL_URL/v1/evaluations/$EVAL_ID/pdf?team_id=$TEAM_ID" \
>   -H "Authorization: Bearer $TOKEN" \
>   -o report.pdf
> ```

> [tab] MCP
>
> Generate a Trust Report for Evaluation e5f6a7b8-… and tell me how to retrieve it.
>
> Generate a Trust Report for Evaluation e5f6a7b8-… and tell me how to retrieve it.

## Next Steps

> [card] [SDK Setup](https://docs.vijil.ai/developer-guide/sdk/setup.md)
>
> Configure the Python client and credential resolution.

> [card] [MCP Tools](https://docs.vijil.ai/developer-guide/agentic/tools.md)
>
> Explore the natural-language tools exposed by the MCP server.

> [card] [Understand Results](https://docs.vijil.ai/developer-guide/evaluate/understanding-results.md)
>
> Interpret Trust Scores and investigate failed Probes.

> [card] [Custom Harnesses](https://docs.vijil.ai/developer-guide/evaluate/custom-harnesses.md)
>
> Build Evaluation suites for your Agent's requirements.

## Troubleshooting

| Symptom | Fix |
| - | - |
| `vijil` is not found | Install `vijil-sdk` in the active Python environment and verify its scripts directory is in `PATH` |
| SDK or CLI authentication fails | Set both `VIJIL_CLIENT_ID` and `VIJIL_CLIENT_SECRET`, or provide a bearer token through `VIJIL_API_KEY` |
| Requests reach the wrong deployment | Run `vijil config set gateway.url <gateway-url>` or pass `gateway=` to `Vijil()` |
| A team-scoped operation fails | Run `vijil auth status`; if authentication resolves no team, set `defaults.team_id` in `~/.vijil/config.toml` |
| The Evaluation service cannot reach the Agent | Verify the Agent URL, protocol, provider API key, and network accessibility |
| MCP tools do not appear | Verify `.mcp.json` is in the project root, confirm `vijil-mcp` is in `PATH`, and restart Claude Code |
| Report generation lacks a team | Pass `team_id=`, set `defaults.team_id`, or authenticate with a token that includes a team claim |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.