Let’s break down what each variable does and where to find them within the UI.
It’s possible to create an API key by using this API endpoint.
Splunk AO API key
You need your Splunk Agent Observability API key to send traces to an Agent Stream from your applications or run experiments in code.1
Select the user menu
Select your user profile in the upper-right corner.

2
Open the API keys page
Select API keys from the user menu.
3
Create a new API key
Select the +Create new key button to create a new API key.
4
Name your API key
Give your API key a name and optionally set an expiration date. By default, API keys expire after a year.
5
Copy your API key
Copy your API key and store it somewhere safe. You will not be able to see this key again.
Splunk AO Console URL
SPLUNK_AO_CONSOLE_URL is the URL for your on-premises, standalone, or custom deployment.
It appears in the browser window when you log into the Splunk Agent Observability homepage.
Example SPLUNK_AO_CONSOLE_URL: https://console.subdomain.yourcompany.com
Splunk AO API URL
SPLUNK_AO_API_URL is an optional custom API URL for connecting to the Agent Observability REST API.
Most users will not need to set up this environment variable, because it will be automatically found from the Console URL:
- If your Console URL is
https://console.subdomain.yourcompany.com, your API URL will automatically be set tohttps://api.subdomain.yourcompany.com - If your Console URL is
https://subdomain.yourcompany.com, your API URL will automatically be set tohttps://api.subdomain.yourcompany.com
Splunk Agent Observability Project
Your Splunk Agent Observability Project is the name of the project you create.
Splunk Agent Observability Agent Stream
The Splunk Agent Observability Agent Stream is the name of the specific Agent Stream that you want to record your traces into. To find or create an Agent Stream, first select the project you’d want to create an Agent Stream from. On the project home screen, the existing Agent Streams are displayed in a table. Select Create Agent Stream to create a new one.
Best practices and tips
- Keep your API keys secure and never share them publicly
- Create separate keys for different applications or environments
- Set expiration dates for temporary access
- Regularly rotate keys for enhanced security
- Use descriptive names to track key usage