Installation
Prerequisites
Section titled âPrerequisitesâ- Oracle Database 12.2 or later
- Oracle APEX (old versions also work, because UC AI uses only some of the APEX APIs)
- Outbound HTTPS access to your AI provider. On on-premises and self-managed databases, you must first configure network ACLs and a TLS wallet. See Network Setup (ACL & Wallet).
Installing UC AI
Section titled âInstalling UC AIâUC AI writes debug information to a log. If you do not have Logger installed, UC AI logs through the apex_debug package.
Option 1: GitHub release scripts
Section titled âOption 1: GitHub release scriptsâThe GitHub release page of each UC AI version contains scripts. These scripts install the UC AI packages and their dependencies.
install_uc_ai_complete.sqlinstalls all UC AI objectsinstall_uc_ai_complete_with_logger.sqlinstalls all UC AI objects and the Logger packageupgrade_packages.sqlupgrades the UC AI packages. Most releases change only the packages. For these releases, run this script to get the new version. Read the release notes also. A release can contain changes that need the complete installation script.
Run the script that you need in your SQL client. It installs the UC AI packages and their dependencies.
Option 2: Install GitHub repository
Section titled âOption 2: Install GitHub repositoryâDownload the source code of the latest release from the GitHub releases page, or clone the GitHub repository.
Make sure that you are on the main branch, not the development branch. Then run this script in any SQL client:
# inside the uc_ai directorysql ./install_uc_ai.sqlThe install_with_logger.sql script installs UC AI together with the Logger package.
# inside the uc_ai directorysql ./install_with_logger.sqlIf you do not want Logger, install its âno opâ (no operation) version instead. This version creates the objects that the UC AI packages need to compile. It writes no log entries.
# inside the uc_ai directorycd ./src/dependencies/logger_3.1.1sql ./logger_install_no_op.sqlSet up API Keys
Section titled âSet up API KeysâYou can manage your API keys for the AI providers in two ways: a key function, or APEX Web Credentials.
Option 1: Key function
Section titled âOption 1: Key functionâThe installation script created the following function. Modify it to return your API keys for the AI providers you want to use.
create or replace function uc_ai_get_key ( p_provider in uc_ai.provider_type) return varchar2as e_unhandled_provider exception;begin -- retrieve and return your keys from a secure location the way you prefer case p_provider when uc_ai.c_provider_openai then return 'change_me'; when uc_ai.c_provider_anthropic then return '...'; when uc_ai.c_provider_google then return '...'; else raise e_unhandled_provider; end case;exception when e_unhandled_provider then raise_application_error(-20001, 'No key defined for provider: ' || p_provider); when others then raise;end uc_ai_get_key;/Option 2: APEX Web Credentials
Section titled âOption 2: APEX Web CredentialsâYou can also store your secret API keys as APEX Web Credentials. This needs an APEX workspace for the schema that holds UC AI. Log in to that workspace. Then go to Workspace Utilities â Web Credentials (guide with screenshots). These guides show how to create the web credential of each provider:
Before you call a UC AI function, set the package variable of your provider to the static ID of the web credential. For example, an OpenAI web credential with the static ID OPENAI needs this code:
uc_ai_openai.g_apex_web_credential := 'OPENAI';Test if it is working
Section titled âTest if it is workingâDECLARE l_result JSON_OBJECT_T;BEGIN -- If you are using APEX Web Credentials set it here -- uc_ai_openai.g_apex_web_credential := 'OPENAI';
l_result := uc_ai.generate_text( p_user_prompt => 'What is APEX Office Print?', p_provider => uc_ai.c_provider_openai, -- change to your preferred provider p_model => uc_ai_openai.c_model_gpt_5_6_luna -- change to your preferred model );
-- Get the AI's response DBMS_OUTPUT.PUT_LINE('AI Response: ' || l_result.get_string('final_message'));END;/Upgrades
Section titled âUpgradesâFor most versions, run only the upgrade_packages.sql script. It upgrades the packages that changed since the last version.
Read the release notes also. A release can contain changes that need the complete installation script.
Next steps
Section titled âNext stepsâUC AI is now installed. Read these pages next: