Request to NordRouter from PowerShell
powershell
$headers = @{
Authorization = "Bearer $env:NORDROUTER_API_KEY"
}
$body = @{
model = "anthropic/claude-sonnet-4.6"
messages = @(
@{ role = "user"; content = "Ответь: работает" }
)
} | ConvertTo-Json -Depth 5
$result = Invoke-RestMethod `
-Method Post `
-Uri "https://nordrouter.com/v1/chat/completions" `
-Headers $headers `
-ContentType "application/json; charset=utf-8" `
-Body $body
$result.choices[0].message.contentFirst set $env:NORDROUTER_API_KEY="sk-nr-...". Do not save the key to .ps1, which will end up in the public repository.