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

# Configuration

> Read and update API Performance evaluation configuration from the Lightsage CLI.

Configuration controls which models, scheduled targets, operations, custom evals, environment profiles, and API base URL Lightsage uses for API Performance.

## Commands

| Command                                     | Description                        |
| ------------------------------------------- | ---------------------------------- |
| `lightsage api-performance config retrieve` | Get the API Performance config.    |
| `lightsage api-performance config update`   | Update the API Performance config. |

Use [Targets](/docs/cli-reference/api-performance-targets) to discover valid `target_type`, `execution_platform`, and `model_id` combinations before updating config.

## Retrieve config

```bash theme={null}
lightsage api-performance config retrieve
```

Retrieve config for one source:

```bash theme={null}
lightsage api-performance config retrieve --source-id source_123
```

Example response:

```json theme={null}
{
  "models": ["claude-sonnet-4.5"],
  "targets": [],
  "operation_ids": ["operation_123"],
  "custom_eval_ids": ["custom_eval_123"],
  "env_vars": {},
  "env_profiles": [
    {
      "id": "prod",
      "name": "Production",
      "env_var_keys": ["API_KEY"]
    }
  ],
  "default_env_profile_id": "prod",
  "api_base_url": "https://api.example.com",
  "can_configure_per_model_schedules": true
}
```

## Update models and eval selection

```bash theme={null}
lightsage api-performance config update \
  --models '["claude-sonnet-4.5"]' \
  --operation-ids '["operation_123"]' \
  --custom-eval-ids '["custom_eval_123"]'
```

Update custom eval selection:

```bash theme={null}
lightsage api-performance config update \
  --custom-eval-ids '["custom_eval_123","custom_eval_456"]'
```

## Update scheduled targets

Use `--targets` for scheduled text or agent targets:

```bash theme={null}
lightsage api-performance config update \
  --targets '[{"target_type":"agent","execution_platform":"claude-code","model_id":"global.anthropic.claude-sonnet-4-6","frequency":"daily","enabled":true}]'
```

Target fields include `target_type`, `execution_platform`, `model_id`, `frequency`, `enabled`, `next_run_at`, and `source_id`.

For text model evals, use `execution_platform` set to `openrouter` and a text model ID from the target catalog.

## Set base URL and environment variables

```bash theme={null}
lightsage api-performance config update \
  --api-base-url "https://api.example.com" \
  --env-vars '{"API_KEY":"sk_test_123","API_BASE_URL":"https://api.example.com"}'
```

<Note>
  Read responses include environment variable keys, not secret values. Update requests can send environment variables, but Lightsage does not return stored secret values.
</Note>

## Configure environment profiles

Environment profiles let you store named sets of environment variables and choose which profiles a specific eval can use.

```bash theme={null}
lightsage api-performance config update \
  --env-profiles '[{"id":"prod","name":"Production","env_vars":{"API_KEY":"sk_live_123"}},{"id":"sandbox","name":"Sandbox","env_vars":{"API_KEY":"sk_test_123"}}]' \
  --default-env-profile-id prod
```

Read responses expose each profile's `id`, `name`, and `env_var_keys`. Secret values are not returned.

## Fields

| Flag                       | Description                                    |
| -------------------------- | ---------------------------------------------- |
| `--models`                 | Model IDs to include as a JSON array.          |
| `--targets`                | Scheduled target objects as a JSON array.      |
| `--operation-ids`          | Operation eval IDs to include as a JSON array. |
| `--custom-eval-ids`        | Custom eval IDs to include as a JSON array.    |
| `--env-vars`               | Environment variable map as JSON.              |
| `--env-profiles`           | Environment profile objects as a JSON array.   |
| `--default-env-profile-id` | Default environment profile ID.                |
| `--source-id`              | Source ID for source-specific config.          |
| `--api-base-url`           | Base URL available to eval runs.               |
