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:
- Authenticating the SDK
- Fetching the current project name (so you know what you’re changing)
- Updating the name in a single API call
- Verifying that the change stuck
- 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
- Agent > All Agents.
- Select your agent and go to deploy, click on the API key section and create an API.
Method 2 – Via Profile section.
- Go to profile (top right corner of your screen)
- Click on My Profile
- 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.
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?
- Make sure you spelled the key project_name exactly.
- Confirm your API key has the update scope.
- 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
- Update Project Settings Using the SDK – https://customgpt.ai/sdk-update-project-settings/
- List All Projects with Pagination – https://customgpt.ai/sdk-list-all-projects-using-pagination/
Conclusion
You just learned how to:
- Authenticate the CustomGPT Python SDK
- Fetch a project’s existing metadata
- Rename the project in a single API call
- 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!
Priyansh is Developer Relations Advocate who loves technology, writer about them, creates deeply researched content about them.