AIO.SetKey

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIO. - OpenRouter AI >

AIO.SetKey

AIO.SetKey

Previous Top Next


MiniRobotLanguage (MRL)

 

AIO.SetKey
Set OpenRouter API Key for Authentication

 

Purpose

 

Sets the OpenRouter API key for authentication. This key is required for all subsequent AIO commands that communicate with the OpenRouter API. The API key identifies your account and enables access to the AI models available through OpenRouter.

 

Syntax

 

AIO.SetKey|$$KEY

 

Parameters

 

$$KEY

The OpenRouter API key. This is a required parameter.

Format: Starts with sk-or-v1- followed by alphanumeric characters.

 

Notes

 

• The API key is stored securely in memory for the duration of the session.

• You can obtain an API key from https://openrouter.ai/keys

• Never share your API key or commit it to version control.

• If the key is invalid, subsequent API calls will fail with an authentication error.

 

Example

 

' Initialize the AIO system

AIO.Init

 

' Set your OpenRouter API key

AIO.SetKey|sk-or-v1-abc123...

 

' Now you can use other AIO commands

AIO.Chat|Hello, how are you?

 

Related Commands

 

AIO.Init - Initialize AIO system

AIO.SetModel - Set AI model

AIO.Chat - Send chat request