Benchmark

Claude Code is 4.2x faster & 3.2x cheaper with CustomGPT.ai plugin. See the report →

CustomGPT.ai Blog

Introducing OpenAI compatibility – Integrate RAG with hundreds of OpenAI ecosystem tools

Author Image

Written by: Priyansh Khodiyar

CustomGPT.ai RAG API headline states it is now OpenAI compatible, beside OpenAI and brain logos on binary background

I’ve been heads-down with our engineering team for the past few weeks working on something that should make life a lot easier for developers in the OpenAI ecosystem. Today, we’re announcing our RAG API is OpenAI compatible.

This new feature is designed to give you a drop-in replacement for OpenAI’s completions endpoint—so you can bring RAG into the entire ecosystem of OpenAI compatible tools, frameworks, and services while leveraging CustomGPT.ai’s unique capabilities. 

What does this mean? Simply swap out a few configuration lines and start using CustomGPT.ai with no fuss. 

Check out this video. To demonstrate, I take an open source project, and swap two lines to Build a RAG Powered Voice AI in Under 2 Minutes!

Why OpenAI Compatibility? RAG + TOOLS

What if you could combine CustomGPT.ai’s RAG API with voice interfaces? Or pair our no-hallucination responses with existing UI libraries? Before now, you’d have to choose between ecosystems or build complex bridges.

Our compatibility layer solves this by seamlessly integrating RAG with the OpenAI tool ecosystem. You get all of CustomGPT.ai’s specialized capabilities—like advanced accuracy and no-hallucinations— while accessing hundreds of existing tools and frameworks built with support for the OpenAI SDK.

Why choose between powerful RAG and a rich tool ecosystem when you can have both?

Try it out!

All you need is a CustomGPT.ai account (start a free trial) and an API Key. Below is a simple Python script showing how you can use to try it out. 

# 1. Just start by installing the OpenAI SDK.

pip install openai

#2.  After that, just set your  api_key and change your base_url to point to your CustomGPT.ai project endpoint, and you’re off to the races:

from openai import OpenAI
client = OpenAI(
    api_key="CUSTOMGPT_API_KEY",  # Your CustomGPT.ai API key
    base_url="https://app.customgpt.ai/api/v1/projects/{project_id}/"  # Replace with your project ID
)
response = client.chat.completions.create(
    model="gpt-4",  # This will be ignored; your project's model will be used
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Who are you?"}
    ],
)
print(response.choices[0].message.content)

How It Works

Endpoint & Parameters: Our RAG API is built to recognize the same chat completion parameters you’d send to OpenAI’s completion endpoint. We ignore or default others  (like voice, temperature and model) —meaning you can keep them in your code, but we won’t actually apply them. If you call an endpoint we don’t support, we’ll return a 404 or 501. Get detailed info here.

  • Same Developer Experience: If you’re used to the OpenAI Python SDK, you can just update the endpoint URL and your API key. Everything else should feel familiar. For advanced features that are unique to CustomGPT.ai, you’ll still need to use our main API.

What’s in It for You

  • Single Endpoint, Multiple Tools: You can stay connected to the OpenAI ecosystem of tools and frameworks AND leverage our RAG API.
  • Fast Integration: If you’ve been contemplating how to integrate RAG into your AI stack, it doesn’t get much simpler than this.
  • Less Overhead: Nobody likes refactoring entire codebases. This approach lets you integrate us in minutes (2 lines of code change), not days.

Get full detailed information about what we support and how to implement this in our CustomGPT.ai OpenAI SDK Compatibility docs.

Known Limitations

Right now we support the completions endpoint. If you’re doing anything fancy with other OpenAI endpoints—like embeddings or audio processing—we’re not supporting those yet. You’ll get a 404 / 501 if you try.

Some optional parameters (like frequency_penalty, stop, or n) are simply ignored. We’ll give you a successful response, just without applying those extras. We built this out based on community requests, with more features in the pipeline. Let us know if you run into any quirks. We plan on collecting developer feedback over the next couple of weeks, then smoothing out any bumps in a future release. 

Documentation & Feedback

For full details, check out our complete OpenAI Compatible SDK documentation here: https://docs.customgpt.ai/reference/customgptai-openai-sdk-compatibility

We’d love to know if there’s anything else you’d like to see in this compatibility layer. Do you have a framework or feature you rely on that we haven’t covered yet? Let us know—you can reach out via our support channels or community forums, and we’ll do our best to get it on the roadmap.

Wrap-Up

Check out the docs, try updating your base URL, and let us know how it goes. We think this compatibility layer will make it simpler for you to explore CustomGPT.ai’s capabilities without tearing apart your existing integration. If you have feedback, ideas for future improvements, or run into issues, shoot them our way. We’re always listening.

Frequently Asked Questions

What does "OpenAI-compatible" actually mean for a RAG API?

Joe Aldeguer, IT Director at the Society of American Florists, said, "CustomGPT.ai knowledge source API is specific enough that nothing off-the-shelf comes close. So I built it myself. Kudos to the CustomGPT.ai team for building a platform with the API depth to make this integration possible." In practice, "OpenAI-compatible" means you can keep the OpenAI SDK and the same chat-completions request pattern, then usually change only the base URL and API key. Retrieval happens behind that compatible endpoint, so answers come from your project's ingested content instead of a general model alone.

What is the safest way to migrate an existing OpenAI app to a RAG endpoint?

Brendan McSheffrey of The Kendall Project said, "We love CustomGPT.ai. It's a fantastic Chat GPT tool kit that has allowed us to create a 'lab' for testing AI models. The results? High accuracy and efficiency leave people asking, 'How did you do it?' We've tested over 30 models with hundreds of iterations using CustomGPT.ai." The lowest-risk migration is to keep your existing SDK client and message format, then switch only the base URL and API key first. Next, test fields the endpoint ignores or defaults, such as model, temperature, and voice, and confirm your app is not calling unsupported endpoints, which can return 404 or 501. That lets you compare outputs before a full cutover.

Do I need my own OpenAI API key to use an OpenAI-compatible RAG endpoint?

Sebastien Laye, Founder of Aslan AI, said, "From beginning to end of the project, CustomGPT was the solution. With further integration of new features, we might even abandon some tools like Bubble or ChatPDF." You do not need your own OpenAI API key for this endpoint. You authenticate with your project API key, because the service mirrors the chat-completions interface while answering from your retrieval project.

Can you keep private enterprise data secure when using OpenAI-compatible RAG tools?

Yes. The service is SOC 2 Type 2 certified, GDPR compliant, and states that data is not used for model training. In a RAG setup, you authenticate with an API key and ground responses in the sources you ingest, which helps keep answers tied to approved content rather than a general model alone.

Why do some OpenAI-compatible UI libraries break after switching to a RAG backend?

Because compatibility is centered on chat completions, not every OpenAI-style feature. The endpoint is designed to recognize the same chat completion parameters, but some fields are ignored or defaulted, including model, temperature, and voice. If a UI library depends on unsupported endpoints or expects behavior outside /v1/chat/completions, it can fail with 404 or 501 responses.

How should you design prompts for a technical agent on an OpenAI-compatible RAG API?

Michael Juul Rugaard, Founding Partner & CEO of The Tokenizer, said, "Based on our huge database, which we have built up over the past three years, and in close cooperation with CustomGPT, we have launched this amazing regulatory service, which both law firms and a wide range of industry professionals in our space will benefit greatly from." For a technical agent, write prompts that define the audience, the task, and the allowed knowledge sources first. Then require answers to stay within retrieved content, state uncertainty when the source does not contain the answer, and follow a fixed output format for steps, citations, or escalation.

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.