๐Ÿฆ€Agento
FeaturesPricingBlog
HomeGuidesConnecting Your OpenAI Account via API or OAuth

Connecting Your OpenAI Account via API or OAuth

Feb 8, 2026ยท2 min read

Table of Contents

  • Prerequisites
  • Option A: Connect via OAuth (Recommended)
  • Option B: Connect via API Key
  • Choose a Model
  • Switching Between Methods
  • Verify the Connection
  • Disconnecting
  • Troubleshooting

This guide shows you how to connect your OpenAI account to an Agento agent so it can use OpenAI models like GPT-5.2 and GPT-4.1. You can connect via OAuth (recommended) or by pasting an API key.

Prerequisites

Before you start, make sure you have:

  • An Agento account with at least one agent created
  • An OpenAI account (Plus or free tier)

If using the API key method, you'll also need a funded API key from platform.openai.com.

Option A: Connect via OAuth (Recommended)

OAuth lets you connect your OpenAI account without managing API keys โ€” authentication happens through the browser and tokens refresh automatically.

  1. Open the Agento dashboard and click on your agent
  2. Go to the Settings tab
  3. Under AI Provider, select OpenAI
  4. Click Sign in with OpenAI
  5. A browser window will open โ€” log in to your OpenAI account and authorize access
  6. Click Allow to grant access
  7. You'll be redirected back to Agento

The settings page will show a green "Connected" indicator once done.

Why OAuth?

  • No key to copy/paste โ€” authentication happens through the browser
  • Automatic refresh โ€” Agento refreshes your token before it expires
  • Revocable โ€” disconnect at any time from your agent settings or from your OpenAI account
  • Works with ChatGPT Plus/Team subscriptions โ€” no separate API billing needed

Option B: Connect via API Key

If you prefer using an API key:

Get Your API Key

  1. Log in to platform.openai.com
  2. Navigate to API Keys in the left sidebar
  3. Click Create new secret key
  4. Give it a descriptive name like "Agento Agent"
  5. Copy the key โ€” you won't be able to see it again

Keep your API key secure. Never share it publicly or commit it to version control.

Add the Key to Your Agent

  1. Open the Agento dashboard and click on your agent
  2. Go to the Settings tab
  3. Under AI Provider, select OpenAI
  4. Paste your API key into the API Key field
  5. Click Save

Agento encrypts your key at rest and never exposes it in the UI after saving.

Choose a Model

After connecting (via either method), select the model your agent should use:

Model Best For
GPT-5.2 Latest and most capable model
GPT-4.1 Reliable general-purpose tasks

You can change the model at any time without reconnecting.

Switching Between Methods

You can switch between OAuth and API key at any time from the Settings tab:

  • If connected via OAuth, click Use API Key Instead to switch
  • If connected via API key, click Switch to OAuth to switch

Only one method can be active at a time.

Verify the Connection

Start your agent (or restart it if already running). Send a test message through web chat or Telegram. If the agent responds, OpenAI is connected.

Disconnecting

To disconnect OpenAI:

  1. Go to your agent's Settings tab
  2. Click Disconnect (for OAuth) or Remove Key (for API key)
  3. The agent will stop using OpenAI and you'll need to configure a different provider

Troubleshooting

OAuth window doesn't open: Make sure pop-ups are allowed for agento.host in your browser.

"Authorization failed" error: Try signing out of OpenAI in your browser first, then retry the OAuth flow.

Agent shows "credential error" (API key): Double-check that you copied the full API key including the sk- prefix.

Agent stops responding after a few days: This is rare, but if your OAuth token can't be refreshed, disconnect and reconnect via the Settings tab.

Agent won't start: Make sure your OpenAI account has billing set up. API keys without a payment method may be restricted.

Back to all guides
๐Ÿฆ€Agento

AI agents that run 24/7 for your business. Deploy in minutes, not hours.

Remsys, Inc

1606 Headway Cir STE 9078

Austin, TX 78754, USA

+1 650 396 9091

๐ŸฆžPowered by OpenClaw

Product

  • Features
  • Pricing
  • Security

Company

  • About
  • Contact

Resources

  • Skills Marketplace
  • Agento Blog
  • API Reference
  • Guides
  • OpenClaw
  • Skills.sh

Legal

  • Privacy
  • Terms
  • GDPR

ยฉ 2026 Agento. All rights reserved.