Configure the API key

Enter your Convai API key in the SDK settings to authenticate your project and enable character communication.

The Convai SDK for Unity authenticates every session using an API key tied to your Convai account. You enter this key once in the Unity Editor — it is stored in your project and used automatically at runtime.

1

Copy your API key

Log in to your Convai dashboard at convai.com, navigate to Account Settings, and copy your API key.

2

Open the Convai configuration window

In the Unity Editor menu bar, open Convai > Account.

The Convai Configuration window opens to the Account section.

3

Paste the API key

Paste your API key into the API Key field.

The key is saved immediately to Assets/Resources/ConvaiSettings.asset. No additional save step is required.

4

Verify the key is accepted

Run GameObject > Convai > Validate Scene Setup. A missing API key appears as a warning in the validator dialog. If no API key warning appears, your key is configured correctly.

How the key is used at runtime

The SDK reads the key from ConvaiSettings via the ICredentialProvider interface before initiating any connection to Convai. You do not need to pass the key manually in code — the SDK resolves it automatically on startup.

For production deployments where storing the key in source control is not acceptable, implement a custom ICredentialProvider that reads the key from a secure source.

Custom credential provider

Next steps

With your API key in place, import a sample scene to verify the SDK is working before you build your own scene.

Import and run sample scenes

Last updated

Was this helpful?