Skip to content

[ADD] ai_chatgpt_oauth: ChatGPT subscription authentication for Odoo … - #3719

Draft
Mayurbechara wants to merge 1 commit into
OCA:19.0from
Mayurbechara:19.0-add-ai_chatgpt_oauth
Draft

[ADD] ai_chatgpt_oauth: ChatGPT subscription authentication for Odoo …#3719
Mayurbechara wants to merge 1 commit into
OCA:19.0from
Mayurbechara:19.0-add-ai_chatgpt_oauth

Conversation

@Mayurbechara

Copy link
Copy Markdown

Summary

This PR adds a new module ai_chatgpt_oauth to route Odoo AI conversational queries, chat bots, and AI Agents through an eligible ChatGPT subscription (Plus, Pro, Team, Enterprise) via an OAuth 2.0 Device Code grant flow.

Problem Statement

In standard Odoo Enterprise AI, all conversational chat and AI agent workflows require paying per-token via a standard OpenAI developer API key. Users with active ChatGPT paid subscriptions ($20/mo Plus, Team, or Pro) could not utilize their subscription for interactive chat in Odoo, incurring duplicate pay-per-token API expenses.

Solution

This module separates AI chat / agent authentication from supporting OpenAI services:

  • Interactive AI Chat & AI Agents: Routed through your authenticated ChatGPT subscription without per-token charges.
  • Supporting Services (Embeddings & Voice): Preserves the standard OpenAI developer API key for knowledge base embeddings (RAG) and Whisper voice transcription.
  • Dynamic UI Model Manager: Allows administrators to dynamically manage, activate, or add new OpenAI models (e.g. GPT-5.6 Luna, GPT-5.6 Terra, GPT-5.6 Sol, GPT-5.5, GPT-5.4, GPT-5.4 Mini) directly from the Settings UI without code modifications.
  • Automatic Background Token Refresh: Handles concurrency-safe OAuth token refresh via a 2-hour background cron job (ir.cron).

Checklist

  • Conforms to OCA quality and commit conventions.
  • Includes complete unit test suite (100% pass rate).
  • Includes standard documentation generated by oca-gen-addon-readme.
  • No sensitive credentials or secrets stored.

@legalsylvain
legalsylvain marked this pull request as draft August 30, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants