Unlocking Free Generative AI in Oracle APEX with Groq – No Paid Plan Needed!

I had been wanting to test the native generative AI features in Oracle APEX for a while, but I couldn’t make much progress with the OpenAI API since it requires a paid plan.

Recently, I came across a LinkedIn post about Groq — an interesting alternative that competes with OpenAI by using open-source language models from companies like Google, Meta, and DeepSeek. After digging deeper, I was impressed by the insane text generation speed — something easy to understand for anyone who’s mined cryptocurrencies, as they use ASIC chips to process responses.

Straight to the point: in this article, I’ll show you how to enable generative AI services in the APEX Builder using the Groq API (which follows the OpenAI-compatible standard).

First things first: you need to sign up at https://groq.com/ and get an API key. One important detail: your APEX version must be at least 24.1 for this to work.

Inside any APEX application, go to Generative AI → AI Services, as shown in the image below.

Create a new service and fill in the details as shown in the example, inserting your API Key. On the same screen, you can test the connection.

If you see an error saying only one service can be used in the App Builder, go back to the previous screen, uncheck the active service, and select the new one — Groq.

In the model configuration, you can choose any of the following:

  • gemma2-9b-it

  • meta-llama/llama-guard-4-12b

  • llama-3.3-70b-versatile

  • llama-3.1-8b-instant

  • whisper-large-v3

  • whisper-large-v3-turbo

  • distil-whisper-large-v3-en

LLaMA may not be the ideal model, but it works well for initial testing.

If you encounter permission issues, log in as SYS or ADMIN and run the commands below (replace your_schema_name with your schema name):

grant execute on DBMS_CLOUD to your_schema_name;
grant execute on DBMS_CLOUD_AI to your_schema_name;

Also, make sure to whitelist Groq in the ACL. (remember to replace your_schema_name accordingly)

BEGIN
    DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
          HOST => 'api.groq.com',
          ACE => XS$ACE_TYPE(PRIVILEGE_LIST => XS$NAME_LIST('http'), 
                             PRINCIPAL_NAME => 'your_schema_name',
                             PRINCIPAL_TYPE => XS_ACL.PTYPE_DB)
);
END;

You're all set — now it’s time to test!

In the SQL Workshop, you’ll see the APEX Assistant button. Simply select a piece of code to start interacting with the AI — whether to ask questions or get suggestions for improvement.

Reference: https://blogs.oracle.com/apex/post/configuring-generative-ai-in-oracle-apex-using-select-ai

0
Subscribe to my newsletter

Read articles from Valter Zanchetti Filho directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Valter Zanchetti Filho
Valter Zanchetti Filho