# Start-IntelligenceXApiKeyLogin

Authenticates the active client with an OpenAI API key.

Command 

**Module**

`IntelligenceX.PowerShell`

**Inputs**

`IntelligenceX.OpenAI.IntelligenceXClient`

Authenticates the active client with an OpenAI API key.

## Syntax

```
Start-IntelligenceXApiKeyLogin
-ApiKey <string>
[-Client <IntelligenceXClient>]
[<CommonParameters>]
```

[#](#method-start-intelligencexapikeylogin-string-intelligencexclient)

## Examples

### Example 1

```powershell
Start-IntelligenceXApiKeyLogin -ApiKey $env:OPENAI_API_KEY
```

Log in with an API key

### Example 2

```powershell
$client = Connect-IntelligenceX; Start-IntelligenceXApiKeyLogin -Client $client -ApiKey $env:OPENAI_API_KEY; Get-IntelligenceXAccount -Client $client
```

Log in with an explicit client and verify account access

### Example 3

```powershell
Start-IntelligenceXApiKeyLogin -ApiKey (Get-Item Env:OPENAI_API_KEY).Value
```

Use API key auth in non-interactive CI flows

## Parameters

**-ApiKey string required**

OpenAI API key used for authentication.

**-Client IntelligenceXClient optionalpipeline: true (ByValue)**

Client instance to use. Defaults to the active client.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:8DF7C6137F9548AB41869388118405A90210BA6E64EED5860A5CC508C10555D7 -->
