# Configuring Discourse AI with internal OpenAI APIs

**URL:** https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238
**Category:** Support
**Tags:** ai
**Created:** [August 17, 2026, 4:38pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238 "2026-08-17T16:38:23Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Soumya\_Ranjan\_Mishra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/soumya_ranjan_mishra/32/514662_2.png) [@Soumya\_Ranjan\_Mishra](https://meta.discourse.org/u/Soumya_Ranjan_Mishra)
#### Post date: [August 17, 2026, 4:38pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/1 "2026-08-17T16:38:23Z")

</div>

Hi everyone,

We are exploring **Discourse AI** to provide a conversational assistant within our Discourse forum for helping users with navigation, features, categories, topics, and general forum-related questions.

We have access to our organization’s own **LLM APIs for GPT and Claude** , and we would like to understand how these models can be configured as providers within Discourse AI. Our goal is to use the LLM capabilities to build a more contextual conversational assistant within our Discourse

Current LLM Configuration

We currently have access to an OpenAI-compatible internal API endpoint:

**Endpoint:**

`https://genai-nexus.api.corpinter.net/openai/deployments/gpt-5.5/chat/completions?api-version=2024-10-21`

**Model:**

`gpt-5.5`

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/5/8/a58794802a35b303b47353e05971950a781d8240.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/0/1/20115b21a644a6222d7814e269683424fa51f0ef.png)

We are particularly interested in guidance from anyone who has configured **Discourse AI with an enterprise/internal OpenAI-compatible API gateway** rather than directly using OpenAI’s public API.

Any configuration examples or recommendations would be greatly appreciated.

Thanks in advance!

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [August 17, 2026, 5:21pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/2 "2026-08-17T17:21:18Z")

</div>

Pick `openai` as the provider, and configure the URL with the one you have.

---

<div class="post-metadata">

### Author: ![Soumya\_Ranjan\_Mishra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/soumya_ranjan_mishra/32/514662_2.png) [@Soumya\_Ranjan\_Mishra](https://meta.discourse.org/u/Soumya_Ranjan_Mishra)
#### Post date: [August 17, 2026, 5:50pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/3 "2026-08-17T17:50:10Z")

</div>

Have tried selecting openAI as the provider and tried still not able to configure..

Any other way or recommendation??

---

<div class="post-metadata">

### Author: ![kddkd](https://avatars.discourse-cdn.com/v4/letter/k/df705f/32.png) [@kddkd](https://meta.discourse.org/u/kddkd)
#### Post date: [August 17, 2026, 6:00pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/4 "2026-08-17T18:00:17Z")

</div>

> [@Soumya\_Ranjan\_Mishra](#):
>
> Rather than directly using OpenAI’s public API

I am also using this API. My model ID is gpt-5.6-sol, and it is currently running without issues.

---

<div class="post-metadata">

### Author: ![Soumya\_Ranjan\_Mishra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/soumya_ranjan_mishra/32/514662_2.png) [@Soumya\_Ranjan\_Mishra](https://meta.discourse.org/u/Soumya_Ranjan_Mishra)
#### Post date: [August 17, 2026, 6:05pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/5 "2026-08-17T18:05:38Z")

</div>

Can you tell me how did you configured.. For me its not running after providing all details..

---

<div class="post-metadata">

### Author: ![kddkd](https://avatars.discourse-cdn.com/v4/letter/k/df705f/32.png) [@kddkd](https://meta.discourse.org/u/kddkd)
#### Post date: [August 17, 2026, 6:26pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/6 "2026-08-17T18:26:42Z")

</div>

In the admin panel, under **AI-LLM-Unconfigured LLM Templates** , select **GPT-5.6 Sol** , and then enter the two pieces of information provided by the third-party API:

**URL of the hosted model service: for example** [ai.com/v1/responses](https://ai.com/v1/responses)

**API key for the hosted model service: provided by the third party**

Below, you can click the “Run Test” button. If it fails, it may be because the URL format is incorrect.

---

<div class="post-metadata">

### Author: ![Soumya\_Ranjan\_Mishra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/soumya_ranjan_mishra/32/514662_2.png) [@Soumya\_Ranjan\_Mishra](https://meta.discourse.org/u/Soumya_Ranjan_Mishra)
#### Post date: [August 17, 2026, 6:44pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/7 "2026-08-17T18:44:25Z")

</div>

Yes after giving all this information am getting internal server error message

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/a/1/3a1b4a622fc93bbbb017a0c4f99894da34a79127.png)

---

<div class="post-metadata">

### Author: ![kddkd](https://avatars.discourse-cdn.com/v4/letter/k/df705f/32.png) [@kddkd](https://meta.discourse.org/u/kddkd)
#### Post date: [August 17, 2026, 6:55pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/8 "2026-08-17T18:55:04Z")

</div>

I tested your URL, but it did not return the information for this image. Could you please tell me which page this image is from?

The result of my test run without entering an API key was: Non-streaming request failed: {“message”:“Unauthorized”}

---

<div class="post-metadata">

### Author: ![kddkd](https://avatars.discourse-cdn.com/v4/letter/k/df705f/32.png) [@kddkd](https://meta.discourse.org/u/kddkd)
#### Post date: [August 17, 2026, 6:56pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/9 "2026-08-17T18:56:48Z")

</div>

It looks like you need to take a screenshot of your full configuration page.

---

<div class="post-metadata">

### Author: ![Soumya\_Ranjan\_Mishra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/soumya_ranjan_mishra/32/514662_2.png) [@Soumya\_Ranjan\_Mishra](https://meta.discourse.org/u/Soumya_Ranjan_Mishra)
#### Post date: [August 17, 2026, 7:04pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/10 "2026-08-17T19:04:57Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/d/8/0/d80f5117aa04c3fe35c89875c41a49e3158ab4ae.png)  
This

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [August 17, 2026, 8:03pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/11 "2026-08-17T20:03:27Z")

</div>

Is there a more detailed error in the logs at `forum.example.com/logs`?

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [August 17, 2026, 10:32pm UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/12 "2026-08-17T22:32:15Z")

</div>

If you are using your internal IP you need to add the domain to the security filter in `DISCOURSE_ALLOWED_INTERNAL_HOSTS`

---

<div class="post-metadata">

### Author: ![Soumya\_Ranjan\_Mishra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/soumya_ranjan_mishra/32/514662_2.png) [@Soumya\_Ranjan\_Mishra](https://meta.discourse.org/u/Soumya_Ranjan_Mishra)
#### Post date: [August 18, 2026, 7:26am UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/13 "2026-08-18T07:26:21Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/9/d/9/9d9f13b1cdf429d3ee0d8f36338318ebb974cfbf.png)

This is the logs

```plaintext
plugins/discourse-ai/lib/completions/dialects/dialect.rb:217:in 'DiscourseAi::Completions::Dialects::Dialect#trim_messages'
plugins/discourse-ai/lib/completions/dialects/dialect.rb:140:in 'DiscourseAi::Completions::Dialects::Dialect#translate'
plugins/discourse-ai/lib/completions/endpoints/base.rb:126:in 'DiscourseAi::Completions::Endpoints::Base#perform_completion!'
plugins/discourse-ai/lib/completions/endpoints/open_ai.rb:54:in 'DiscourseAi::Completions::Endpoints::OpenAi#perform_completion!'
plugins/discourse-ai/lib/completions/llm.rb:439:in 'DiscourseAi::Completions::Llm#generate'
plugins/discourse-ai/lib/configuration/llm_validator.rb:36:in 'DiscourseAi::Configuration::LlmValidator#run_test'
plugins/discourse-ai/app/controllers/discourse_ai/admin/ai_llms_controller.rb:159:in 'DiscourseAi::Admin::AiLlmsController#test'
actionpack (8.0.4) lib/action_controller/metal/basic_implicit_render.rb:8:in 'ActionController::BasicImplicitRender#send_action'
actionpack (8.0.4) lib/abstract_controller/base.rb:215:in 'AbstractController::Base#process_action'
activesupport (8.0.4) lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks'
app/controllers/application_controller.rb:442:in 'block in ApplicationController#with_resolved_locale'
i18n (1.14.7) lib/i18n.rb:353:in 'I18n::Base#with_locale'
app/controllers/application_controller.rb:442:in 'ApplicationController#with_resolved_locale'
actionpack (8.0.4) lib/action_dispatch/routing/route_set.rb:908:in 'ActionDispatch::Routing::RouteSet#call'
lib/middleware/omniauth_bypass_middleware.rb:35:in 'Middleware::OmniauthBypassMiddleware#call'
lib/middleware/crawler_hooks.rb:11:in 'Middleware::CrawlerHooks#call'
rack (2.2.23) lib/rack/tempfile_reaper.rb:15:in 'Rack::TempfileReaper#call'
rack (2.2.23) lib/rack/conditional_get.rb:27:in 'Rack::ConditionalGet#call'
rack (2.2.23) lib/rack/head.rb:12:in 'Rack::Head#call'
actionpack (8.0.4) lib/action_dispatch/middleware/cookies.rb:706:in 'ActionDispatch::Cookies#call'
actionpack (8.0.4) lib/action_dispatch/middleware/callbacks.rb:31:in 'block in ActionDispatch::Callbacks#call'
activesupport (8.0.4) lib/active_support/callbacks.rb:100:in 'block in ActiveSupport::Callbacks#run_callbacks'
actionpack (8.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:31:in 'ActionDispatch::DebugExceptions#call'
actionpack (8.0.4) lib/action_dispatch/middleware/show_exceptions.rb:32:in 'ActionDispatch::ShowExceptions#call'
logster (2.20.1) lib/logster/middleware/reporter.rb:40:in 'Logster::Middleware::Reporter#call'
lib/middleware/default_headers.rb:13:in 'Middleware::DefaultHeaders#call'
railties (8.0.4) lib/rails/rack/logger.rb:41:in 'Rails::Rack::Logger#call_app'
railties (8.0.4) lib/rails/rack/logger.rb:29:in 'Rails::Rack::Logger#call'
lib/middleware/enforce_hostname.rb:23:in 'Middleware::EnforceHostname#call'
rack (2.2.23) lib/rack/method_override.rb:24:in 'Rack::MethodOverride#call'
actionpack (8.0.4) lib/action_dispatch/middleware/executor.rb:16:in 'ActionDispatch::Executor#call'
rack (2.2.23) lib/rack/sendfile.rb:127:in 'Rack::Sendfile#call'
rack-mini-profiler (4.0.1) lib/mini_profiler.rb:191:in 'Rack::MiniProfiler#call'
message_bus (4.4.1) lib/message_bus/rack/middleware.rb:60:in 'MessageBus::Rack::Middleware#call'
lib/middleware/request_tracker.rb:321:in 'Middleware::RequestTracker#call'
actionpack (8.0.4) lib/action_dispatch/middleware/remote_ip.rb:96:in 'ActionDispatch::RemoteIp#call'
lib/middleware/overload_protections.rb:22:in 'Middleware::OverloadProtections#call'
lib/middleware/processing_request.rb:14:in 'Middleware::ProcessingRequest#call'
railties (8.0.4) lib/rails/engine.rb:535:in 'Rails::Engine#call'
railties (8.0.4) lib/rails/railtie.rb:226:in 'Kernel#public_send'
railties (8.0.4) lib/rails/railtie.rb:226:in 'Kernel#method_missing'
rack (2.2.23) lib/rack/urlmap.rb:74:in 'block in Rack::URLMap#call'
rack (2.2.23) lib/rack/urlmap.rb:58:in 'Array#each'
unicorn (6.1.0) lib/unicorn/http_server.rb:634:in 'Unicorn::HttpServer#process_client'
unicorn (6.1.0)

```

---

<div class="post-metadata">

### Author: ![Soumya\_Ranjan\_Mishra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/soumya_ranjan_mishra/32/514662_2.png) [@Soumya\_Ranjan\_Mishra](https://meta.discourse.org/u/Soumya_Ranjan_Mishra)
#### Post date: [August 18, 2026, 9:47am UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/14 "2026-08-18T09:47:08Z")

</div>

any suggestion/recommendation regarding the logs i shared what to do next

---

<div class="post-metadata">

### Author: ![singi2016cn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/singi2016cn/32/532755_2.png) [@singi2016cn](https://meta.discourse.org/u/singi2016cn)
#### Post date: [August 19, 2026, 1:28am UTC](https://meta.discourse.org/t/configuring-discourse-ai-with-internal-openai-apis/410238/15 "2026-08-19T01:28:33Z")

</div>

In my experience, try changing the `Context window` value to something like 200000 or 128000.
