Update an Agent Name with CustomGPT.ai RAG API’s Python SDK – A How‑To Tutorial

Author Image

Written by: Priyansh Khodiyar

Update an Agent Name with CustomGPT.ai RAG API’s Python SDK – A How‑To Tutorial

Update an agent names meaningful is vital for organization—especially when you manage multiple chatbots. In this guide, you’ll learn how to rename a CustomGPT project (agent) entirely in Python using the official CustomGPTs RAG APIs Python SDK implementation.

We’ll move through:

  1. Authenticating the SDK
  2. Fetching the current project name (so you know what you’re changing)
  3. Updating the name in a single API call
  4. Verifying that the change stuck
  5. Troubleshooting common hiccups

If you’re brand‑new to CustomGPT, first sign up and review Getting Started with CustomGPT.ai. For deeper reference, check the official docs. A runnable notebook lives in our GitHub Cookbook.

Prerequisites

  • A CustomGPT API key with project‑update permission
  • Python 3 (Google Colab, Jupyter, or local)
  • The customgpt‑client package installed → pip install customgpt-client
  • The project ID of the bot you want to rename

Once those are ready, open your editor or notebook and follow along.

1 – Install & Authenticate the SDK

We begin by installing (if needed) and authenticating the SDK so every subsequent call carries your token.

# Install the SDK (run once per environment)
!pip install customgpt-client

# Import the SDK interface
from customgpt_client import CustomGPT
CustomGPT.api_key = "YOUR_API_TOKEN"   # ← replace with your real token

Get API keys

To get your API key, there are two ways:

Method 1 – Via Agent

  1. Agent > All Agents.
  2. Select your agent and go to deploy, click on the API key section and create an API. 

Method 2 – Via Profile section.

  1. Go to profile (top right corner of your screen)
  2. Click on My Profile
  3. You will see the screen something like this (below screenshot). Here you can click on “Create API key”, give it a name and copy the key.
Create API

Please save this secret key somewhere safe and accessible. For security reasons, You won’t be able to view it again through your CustomGPT.ai account. If you lose this secret key, you’ll need to generate a new one.

The api_key assignment means you don’t have to manually set headers—every SDK method now runs under your account.

2 – Retrieve the Current Project Name

Before changing anything, it’s smart to confirm the existing name and ensure you’re targeting the correct project.

# Pull current project metadata
project_info = CustomGPT.Project.get(
    project_id="YOUR_PROJECT_ID"       # ← your existing project ID
)

print("Current Name:", project_info.parsed.data.project_name)

Here’s what’s happening:

  • Project.get calls GET /projects/{id} and returns a structured object.
  • We print project_name so we know the bot’s current label.

With confirmation in hand, let’s move on to renaming.

3 – Update the Project Name

Now you can rename or update an agent name (project name)—for clarity, versioning, or branding.

update_resp = CustomGPT.Project.update(
    project_id="YOUR_PROJECT_ID",       # Target project
    project_name="New Project Name v2"  # Desired new name
)

print("Rename Status:", update_resp.status)   # Expect "success"

Explanation of key lines:

  • Project.update issues a PATCH/PUT to /projects/{id}.
  • Passing project_name instructs the API to set the new label.
  • A “success” status in the response confirms the backend accepted your change.

Great—API says it’s successful. Let’s double‑check.

4 – Verify the Change

Fetching the project again ensures the new name is propagated.

project_updated = CustomGPT.Project.get(
    project_id="YOUR_PROJECT_ID"
)

print("Updated Name:", project_updated.parsed.data.project_name)

If you see “New Project Name v2” (or whatever you set), you’re all done.

5 – Troubleshooting & Tips

Rename didn’t stick?

  1. Make sure you spelled the key project_name exactly.
  2. Confirm your API key has the update scope.
  3. Retry after a few seconds—network hiccups happen.

Accidentally renamed the wrong bot?
Just call Project.update again with the original name.

Want to rename many projects?
Put the rename code in a loop over a list of project_ids.

For other errors—rate limits, auth failures—check the response body and consult the API docs.

Related Guides

Conclusion

You just learned how to:

  1. Authenticate the CustomGPT Python SDK
  2. Fetch a project’s existing metadata
  3. Rename the project in a single API call
  4. Verify that the new name is saved

This simple pattern—GET, UPDATE, GET—is handy whenever you need to tweak basic project properties. Keep your naming conventions consistent, and your future self (and teammates) will thank you.

Happy coding, and keep those bot names clear and descriptive!

Build a Custom GPT for your business, in minutes.

Deliver exceptional customer experiences and maximize employee efficiency with custom AI agents.

Trusted by thousands of organizations worldwide

Related posts

Leave a reply

Your email address will not be published. Required fields are marked *

*

3x productivity.
Cut costs in half.

Launch a custom AI agent in minutes.

Instantly access all your data.
Automate customer service.
Streamline employee training.
Accelerate research.
Gain customer insights.

Try 100% free. Cancel anytime.