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

# Create api key

Use a Foveus API key to connect your service to your workspace.

Your service sends executions, logs, context, and issue evidence to Foveus using this key.

## API key modes

Foveus supports two key modes:

| Mode   | How it is created                       | Use for                                                |
| ------ | --------------------------------------- | ------------------------------------------------------ |
| `test` | Created automatically during onboarding | Local development, sandbox testing, QA, and onboarding |
| `live` | Created manually from Settings          | Production telemetry                                   |

Use your **test key** while setting up Foveus.

Create a **live key** only when you are ready to send production telemetry.

<Note>
  Foveus defaults to **Test mode**. You do not need to set `Mode` when using a test key.
</Note>

## Test keys

Your test key is created automatically during onboarding.

A test key looks similar to:

```text theme={null}
fov_test_...
```

Use this key for:

* local development
* sandbox services
* QA environments
* private beta setup

During private beta, test keys cannot be rotated from the Settings page. Rotation controls will be added later.

## Live keys

Create a live key when your service is ready to send production telemetry.

Open your Foveus dashboard and go to **Settings → API keys**.

Create a new key in **Live mode**.

A live key should look similar to:

```text theme={null}
fov_live_...
```

<Warning>
  Treat live API keys like production secrets. Do not commit them to source control, paste them into logs, or share them in chat.
</Warning>

## Store your key safely

For local development, use .NET user secrets:

```bash theme={null}
dotnet user-secrets set "Foveus:ApiKey" "fov_test_..."
```

For deployed services, use your platform’s secret manager.

Common options include:

* Azure Key Vault
* AWS Secrets Manager
* Google Secret Manager
* Kubernetes secrets
* Render environment variables
* Docker secrets

## Use a test key

For local development or sandbox telemetry, you only need to provide your test key.

```json theme={null}
{
  "Foveus": {
    "ApiKey": "fov_test_..."
  }
}
```

Then configure the SDK from application configuration.

```csharp theme={null}
builder.Services.AddFoveus(builder.Configuration);
```

With this setup, Foveus uses safe defaults:

| Option        | Default                      |
| ------------- | ---------------------------- |
| `ServiceName` | Your project assembly name   |
| `Environment` | Your current app environment |
| `Mode`        | `test`                       |

You can override these values when needed.

```json theme={null}
{
  "Foveus": {
    "ApiKey": "fov_test_...",
    "ServiceName": "orders-api",
    "Environment": "staging"
  }
}
```

You still do not need to set `Mode` for test telemetry. Foveus uses Test mode by default.

## Use a live key

When you are ready to send production telemetry, use a live key and set `Mode` to `live`.

```json theme={null}
{
  "Foveus": {
    "ApiKey": "fov_live_...",
    "ServiceName": "orders-api",
    "Environment": "production",
    "Mode": "live"
  }
}
```

<Warning>
  Do not use a test key for production telemetry. Do not use a live key in local development.
</Warning>

## Configuration options

| Option        | Required? | Default                 | Description                                                                                                                |
| ------------- | --------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `ApiKey`      | Yes       | None                    | Your Foveus API key. Test keys are created automatically during onboarding. Live keys are created from Settings.           |
| `ServiceName` | No        | Project assembly name   | The logical name of your service. Override this if your assembly name is not how you want the service to appear in Foveus. |
| `Environment` | No        | Current app environment | The deployment environment, such as `Development`, `staging`, or `production`.                                             |
| `Mode`        | No        | `test`                  | The Foveus data mode. Set this to `live` only when using a live key for production telemetry.                              |

## Permissions

During private beta, Foveus API keys are created with the permissions needed to ingest telemetry.

A key may be allowed to send:

* executions
* logs
* metrics
* context
* issue evidence

Later, workspace owners may be able to create keys with narrower permissions for specific services or environments.

## Rotate a live key

Rotate a live key if:

* the key was exposed
* a team member with access leaves
* your security policy requires periodic rotation
* you are replacing an old production key

To rotate a live key:

1. Create a new live key.
2. Update your service configuration.
3. Deploy the change.
4. Confirm new telemetry is arriving.
5. Disable or delete the old key.

<Note>
  During private beta, this rotation flow applies to live keys only. Test key rotation from Settings is not available yet.
</Note>

## Troubleshooting

### No executions appear

Check that:

* the API key is valid
* the key mode matches the dashboard mode you are viewing
* your service can reach Foveus
* the SDK is configured correctly
* your selected time range includes the request time

If you are using the default service name, search by the project assembly name.

If you overrode `ServiceName`, search by that value instead.

```text theme={null}
service:orders-api
```

### Telemetry appears in the wrong mode

Foveus defaults to Test mode.

For test telemetry, you can omit `Mode`.

```json theme={null}
{
  "Foveus": {
    "ApiKey": "fov_test_..."
  }
}
```

For live telemetry, set `Mode` to `live`.

```json theme={null}
{
  "Foveus": {
    "ApiKey": "fov_live_...",
    "ServiceName": "orders-api",
    "Environment": "production",
    "Mode": "live"
  }
}
```

### The service name looks wrong

By default, Foveus uses your project assembly name as the service name.

If that is not the name you want to see in Foveus, override `ServiceName`.

```json theme={null}
{
  "Foveus": {
    "ApiKey": "fov_test_...",
    "ServiceName": "orders-api"
  }
}
```

### The key appears in logs

Remove the key from logs immediately and rotate it if rotation is available.

Foveus also redacts known sensitive values where possible, but you should never intentionally log API keys.

If a test key is exposed during private beta and you cannot rotate it from Settings, contact Foveus support.

## Next steps

* Install the .NET SDK: [Install the .NET SDK](/get-started/install-dotnet-sdk)
* Send your first execution: [Send your first execution](/get-started/send-first-execution)
* Learn about Test and Live modes: [Test and Live modes](/concepts/test-and-live-modes)
* Review API key safety: [API keys](/security/api-keys)
