Skip to main content

How to Connect Your Existing ChatGPT/Codex Subscription to Your Managed AI Agent on Cloudways

Learn how to sign in with your existing ChatGPT/Codex subscription using OAuth, so your Managed AI Agent can use OpenAI models without a separate API key.

Written by Usama Zafar

A Managed AI Agent needs an LLM (Large Language Model) to think and respond to requests. Usually, you connect one by adding an API key from an LLM provider.

If you already pay for a ChatGPT/Codex subscription, you can use it instead. Rather than creating and pasting an API key, you sign in to your OpenAI account through OAuth, and your agent uses your subscription to respond.

OAuth is a secure sign in method that lets your agent access your OpenAI account without you sharing your password with Cloudways.

This guide explains how to connect your existing ChatGPT/Codex subscription to your Managed AI Agent from the LLM Provider section, how to confirm the connection, and what to do if something goes wrong.

Note:

Right now, you can connect your subscription from the dedicated LLM Provider section under the LLM & Channels tab of your agent. Support for the Deploy Agent flow and the Setup Wizard is coming very soon.

Before You Start

Before connecting your subscription, make sure you have:

  • An active paid Cloudways account with access to Managed AI Agents.

  • A Managed AI Agent already deployed on the Cloudways Platform.

  • An active ChatGPT/Codex subscription. Plus, Pro, and Business plans are supported.

  • Access to the OpenAI account that holds the subscription, so you can sign in and approve the connection.

  • Device code sign in turned on in your ChatGPT security settings (covered in Step #1 below)

Note: If you would rather use an API key, see How to Connect an LLM Provider to Your Managed AI Agent on Cloudways. Both options work, and you can switch between them at any time.

Important: Never share your OpenAI sign in details or screenshots of your authorization screen publicly, in tickets, or in public documents.

Subscription or API Key. Which One Should You Use?

ChatGPT/Codex subscription (OAuth)

OpenAI API key

How you connect

Sign in to your OpenAI account

Paste a key from your provider

How you are billed

Covered by your existing subscription

Pay per use, billed by OpenAI

Usage limits

Shared with your own ChatGPT/Codex use

Based on your API account limits

Best for

Personal use and light workloads

Heavier or always on workloads

Important: Subscription limits belong to you personally and reset on a rolling basis. Your agent uses the same allowance as your own ChatGPT or Codex sessions. If your agent runs a lot of tasks, you may reach your limit sooner than usual, and your own sessions can be affected too.

How to Connect Your ChatGPT/Codex Subscription

Step #1. Enable Device Code Sign In in ChatGPT

Your agent runs on a remote server, so it signs in using a device code instead of a browser on the same machine. Before connecting, turn this on in your ChatGPT account.

  • Log in to ChatGPT with the account that holds your subscription.

  • Click your profile icon and open Settings.

  • Go to the Security section.

  • Turn on Enable device code sign-in for Codex, Excel, PowerPoint, and Word.

Note: If you use a ChatGPT Business workspace, your workspace admin may need to turn this on in the workspace permissions. If you do not see the toggle, ask your admin to enable it.

Step #2. Go to AI Agents

  • Log in to your Cloudways Platform account.

  • From the left side navigation menu, click AI Agents under the Cloudways AI section.

  • This opens the Managed AI Agents page, where all your agents are listed.

Step #3. Open Your Agent

  • Find the agent you want to connect your subscription to.

  • Click the agent card to head inside the agent.


​

Step #4. Go to the LLM Provider Section

  • On the agent details page, click the LLM & Channels tab.

  • Stay on the LLM Provider section. This is where you choose how your agent connects to an AI model.

  • Select OpenAI from the list of providers.

  • Choose the ChatGPT/Codex subscription option instead of entering an API key.

Step #5. Sign In to Your OpenAI Account

  • Under Sign in with OpenAI, click Connect.

  • A setup code is shown on the screen. Keep this screen open, as you will need the code in the next part.

  • Open the OpenAI sign in page from the link provided and enter the setup code when asked.

  • Sign in with the account that holds your ChatGPT/Codex subscription, then approve the request.

Step #6. Confirm the Connection

  • After you approve, you are brought back to the LLM Provider section.

  • A success message confirms that your subscription is connected.

  • If the status does not update, click Sync at the top of the LLM Provider section. This refreshes the connection status.

Step #7. Test the Connection

  • Open your agent by clicking Open Agent on the Managed AI Agents page.

  • Send it a simple message, such as asking it to introduce itself.

  • If the agent replies, your subscription is connected and working.

Note:

You can also connect your subscription over SSH. Device code sign in and other sign in methods for all supported providers are already available through SSH. The LLM Provider section is the easiest route for most users.

Troubleshooting

I do not see the subscription option

Make sure you selected OpenAI as the provider. The subscription option is shown only for OpenAI. If you still do not see it, reach out to us via chat.

I cannot find the device code toggle in ChatGPT

Open ChatGPT, go to Settings, then Security, and look for Enable device code sign-in for Codex, Excel, PowerPoint, and Word. If the option is missing and you use a Business workspace, your workspace admin controls it and needs to enable it in the workspace permissions.

The sign in failed

Make sure device code sign in is turned on in your ChatGPT security settings (Step #1). Also confirm that you signed in with the OpenAI account that holds your ChatGPT/Codex subscription and that the subscription is active. Then click the sign in button and try again.

The sign in page closed or I cancelled by mistake

Click the sign in button again and approve access when prompted. Nothing is saved until you approve.

The status still does not show as connected

Click Sync at the top of the LLM Provider section. This refreshes the connection status without requiring you to reconnect.

My agent stopped responding after working earlier

Your sign in may have expired, or you may have reached your subscription usage limit. Check your usage in your OpenAI account, then reconnect your subscription from the LLM Provider section if needed.

My own ChatGPT or Codex sessions hit a limit sooner than usual

Your agent and your personal sessions share the same allowance. Reduce your agent's workload, or switch to an OpenAI API key for heavier use.

I want to stop my agent from using my subscription

Go to the LLM & Channels tab, open the LLM Provider section, and switch to an API key or another provider. You can also manage connected apps from your OpenAI account settings.

Frequently Asked Questions

Do I need an API key to use my ChatGPT/Codex subscription?

No. The subscription option uses OAuth sign in, so no API key is needed.

Do I have to pay extra to use my subscription with my agent?

No extra charge applies from Cloudways. Your agent uses your existing subscription. Your Cloudways plan is billed separately.

Can I use it with any ChatGPT plan?

Plus, Pro, and Business plans are supported.

Is my OpenAI password shared with Cloudways?

No. You sign in on OpenAI's own page, and Cloudways never sees your password.

Can I switch between my subscription and an API key?

Yes. You can switch at any time from the LLM Provider section.

Can I connect my subscription from the Setup Wizard or while deploying an agent?

Not yet. For now, connect it from the LLM Provider section under the LLM & Channels tab. Support for the Setup Wizard and Deploy Agent flow is coming very soon.

Related Articles

Need More Help?

If you get stuck, reach out to our support team via chat. You can also learn from and share tips with other users in our communities.

That's it! We hope this article was useful.

Did this answer your question?