An OpenAI-compatible RAG API lets applications that already use the Chat Completions format send requests to a managed retrieval system grounded in approved business content. When a tool supports a configurable API base URL and Bearer token, developers can often connect it to CustomGPT.ai by changing the endpoint, API key, and project ID rather than rebuilding the application.
Compatibility still depends on the endpoints, request fields, model validation, streaming behavior, and advanced features the client requires. CustomGPT.ai’s OpenAI SDK compatibility endpoint is currently in Beta and is best suited to experimentation, evaluations, and straightforward Chat Completions integrations.
The 30-Second Answer
A compatible OpenAI client can continue sending a messages array through its existing SDK or interface. Instead of routing the request to a generic model endpoint, the client sends it to a CustomGPT.ai agent grounded in your connected documents, websites, help-center content, or other approved sources.
| Existing configuration | CustomGPT.ai configuration |
|---|---|
| OpenAI API key | CustomGPT.ai API key |
| OpenAI API endpoint | Agent-specific CustomGPT.ai endpoint |
| Generic model knowledge | Knowledge retrieved from approved business content |
| Existing SDK or client | Retained when compatible |
The three primary changes are:
- Replace the existing API key with a CustomGPT.ai API key.
- Replace the API base URL with the agent-specific CustomGPT.ai URL.
- Include the project ID associated with the CustomGPT.ai agent.
This does not mean that every OpenAI endpoint, parameter, tool, or application behavior is supported.
What Is an OpenAI-Compatible RAG API?
An OpenAI-compatible RAG API accepts a documented subset of the OpenAI Chat Completions request and response format while grounding answers in information retrieved from connected knowledge sources.
“OpenAI-compatible” generally describes API-format compatibility. It does not imply complete equivalence with the OpenAI platform.
There are several different types of compatibility:
- API-format compatibility: The client can send the supported Chat Completions request structure.
- SDK compatibility: The SDK allows developers to change the base URL and API key.
- Model compatibility: The client does not require validation against a specific OpenAI-hosted model.
- Feature compatibility: The workflow does not depend on unsupported functionality such as tool calling or structured outputs.
- Platform equivalence: Not provided. The compatibility endpoint does not reproduce every OpenAI API resource.
A client is a strong candidate for direct compatibility when it:
- Uses the Chat Completions request format.
- Allows a custom API base URL.
- Allows a custom Bearer API key.
- Can target an agent-specific endpoint.
- Does not require unsupported OpenAI endpoints.
- Can process a Chat Completions-style response.
Architecture Overview
User or application
↓
OpenAI-compatible client
↓
CustomGPT.ai compatibility endpoint
↓
API authentication and agent selection
↓
Retrieval over connected business content
↓
Model generation
↓
Answer with optional inline source references
↓
Application interface
The application sends messages through an OpenAI-compatible client. CustomGPT.ai authenticates the request, identifies the selected agent, retrieves relevant information from the content connected to that agent, and generates an answer based on the retrieved context.
CustomGPT.ai calls user-created assistants agents in the product interface. Some API paths retain the legacy term projects. The projectId in the endpoint identifies the agent receiving the request.
The surrounding application remains responsible for:
- Authenticating its users
- Authorizing access to the correct agent
- Protecting the API key
- Managing conversation history
- Validating user input
- Rendering answers and sources
- Handling errors and rate limits
- Monitoring application behavior
Five-Minute Quick Start
1. Create or select a CustomGPT.ai agent
Create an agent in CustomGPT.ai or select an existing agent that contains the knowledge needed by the application.
2. Connect approved knowledge sources
Connect documents, websites, help-center pages, knowledge bases, or other supported sources. Wait until the sources have finished processing before testing retrieval.
Do not describe this process as model training. The agent is being grounded in connected and indexed content.
3. Generate an API key
Create a CustomGPT.ai API key with the permissions needed for the integration. Use separate keys for development and production.
4. Copy the project ID
Copy the project ID associated with the agent. Although the product interface uses “agent,” the compatibility endpoint currently uses the projects path.
5. Configure the API base URL
Use the following base URL with an OpenAI SDK:
https://app.customgpt.ai/api/v1/projects/PROJECT_ID/
The complete Chat Completions endpoint is:
POST https://app.customgpt.ai/api/v1/projects/PROJECT_ID/chat/completions
6. Replace the API key
Send the CustomGPT.ai key as a Bearer token:
Authorization: Bearer CUSTOMGPT_API_KEY
7. Send a test request
Start with a minimal request containing only:
modelmessagesstream
The model field may be required by the client SDK, but its value is currently ignored by the compatibility endpoint.
8. Validate the result
Test a question that is directly answered by one of the connected sources. Confirm that:
- The response is relevant.
- The application parses the response correctly.
- Streaming works when enabled.
- Inline source references appear when requested.
- Unsupported fields are not being added automatically.
9. Move secrets to the server
Never expose the CustomGPT.ai API key in browser JavaScript, mobile application bundles, public repositories, screenshots, or client-side environment variables.
10. Test failure conditions
Before deployment, test:
- Invalid API keys
- Incorrect project IDs
- Unsupported request fields
- Interrupted streams
- Empty responses
- Usage limits
- Source-processing delays
- Application timeouts
Python SDK Example
Reviewed: July 31, 2026
SDK: OpenAI Python SDK 2.51.0
Runtime: Python 3.10 or later
Install the SDK:
python -m pip install "openai==2.51.0"
Set the required environment variables:
export CUSTOMGPT_API_KEY="replace_with_your_key"
export CUSTOMGPT_PROJECT_ID="replace_with_your_project_id"
Non-Streaming Python Request
import os
import sys
from openai import OpenAI, APIConnectionError, APIStatusError
api_key = os.environ.get("CUSTOMGPT_API_KEY")
project_id = os.environ.get("CUSTOMGPT_PROJECT_ID")
if not api_key or not project_id:
raise RuntimeError(
"Set CUSTOMGPT_API_KEY and CUSTOMGPT_PROJECT_ID."
)
client = OpenAI(
api_key=api_key,
base_url=(
"https://app.customgpt.ai/api/v1/"
f"projects/{project_id}/"
),
timeout=60.0,
max_retries=2,
)
try:
response = client.chat.completions.create(
# Required by the SDK but currently ignored
# by the CustomGPT.ai compatibility endpoint.
model="customgpt-agent",
messages=[
{
"role": "system",
"content": (
"Answer using the connected knowledge base."
),
},
{
"role": "user",
"content": "What is our refund policy?",
},
],
extra_body={
"is_inline_citation": True,
},
)
answer = response.choices[0].message.content
print(answer or "No answer returned.")
except APIStatusError as exc:
print(
f"API returned {exc.status_code}: "
f"{exc.response.text}",
file=sys.stderr,
)
raise
except APIConnectionError as exc:
print(
f"Could not reach the API: {exc}",
file=sys.stderr,
)
raise
The assistant response is available under:
response.choices[0].message.content
Do not require an OpenAI-style usage object. Token-usage information may not be returned through the compatibility response.
Streaming Python Request
import os
import sys
from openai import OpenAI, APIConnectionError, APIStatusError
api_key = os.environ.get("CUSTOMGPT_API_KEY")
project_id = os.environ.get("CUSTOMGPT_PROJECT_ID")
if not api_key or not project_id:
raise RuntimeError(
"Set CUSTOMGPT_API_KEY and CUSTOMGPT_PROJECT_ID."
)
client = OpenAI(
api_key=api_key,
base_url=(
"https://app.customgpt.ai/api/v1/"
f"projects/{project_id}/"
),
timeout=60.0,
max_retries=2,
)
try:
stream = client.chat.completions.create(
model="customgpt-agent",
messages=[
{
"role": "user",
"content": (
"Summarize the customer onboarding process."
),
}
],
stream=True,
extra_body={
"is_inline_citation": True,
},
)
for chunk in stream:
if not chunk.choices:
continue
content = chunk.choices[0].delta.content
if content:
print(content, end="", flush=True)
print()
except APIStatusError as exc:
print(
f"nAPI returned {exc.status_code}: "
f"{exc.response.text}",
file=sys.stderr,
)
raise
except APIConnectionError as exc:
print(
f"nStreaming connection failed: {exc}",
file=sys.stderr,
)
raise
Node.js and TypeScript Example
Reviewed: July 31, 2026
SDK: OpenAI Node.js SDK 7.1.0
Runtime: Node.js 22 or later
Install the package:
npm install openai@7.1.0
Set the environment variables:
export CUSTOMGPT_API_KEY="replace_with_your_key"
export CUSTOMGPT_PROJECT_ID="replace_with_your_project_id"
Non-Streaming Node.js Request
import OpenAI from "openai";
const apiKey = process.env.CUSTOMGPT_API_KEY;
const projectId = process.env.CUSTOMGPT_PROJECT_ID;
if (!apiKey || !projectId) {
throw new Error(
"Set CUSTOMGPT_API_KEY and CUSTOMGPT_PROJECT_ID."
);
}
const client = new OpenAI({
apiKey,
baseURL:
`https://app.customgpt.ai/api/v1/` +
`projects/${projectId}/`,
timeout: 60_000,
maxRetries: 2,
});
try {
const response = await client.chat.completions.create({
// Required by the SDK but currently ignored
// by the compatibility endpoint.
model: "customgpt-agent",
messages: [
{
role: "system",
content:
"Answer using the connected knowledge base.",
},
{
role: "user",
content: "What is our refund policy?",
},
],
});
console.log(
response.choices[0]?.message?.content ??
"No answer returned."
);
} catch (error) {
if (error instanceof OpenAI.APIError) {
console.error(
`API returned ${error.status}: ${error.message}`
);
} else {
console.error(error);
}
process.exitCode = 1;
}
Streaming Node.js Request
import OpenAI from "openai";
const apiKey = process.env.CUSTOMGPT_API_KEY;
const projectId = process.env.CUSTOMGPT_PROJECT_ID;
if (!apiKey || !projectId) {
throw new Error(
"Set CUSTOMGPT_API_KEY and CUSTOMGPT_PROJECT_ID."
);
}
const client = new OpenAI({
apiKey,
baseURL:
`https://app.customgpt.ai/api/v1/` +
`projects/${projectId}/`,
timeout: 60_000,
maxRetries: 2,
});
try {
const stream = await client.chat.completions.create({
model: "customgpt-agent",
messages: [
{
role: "user",
content:
"Summarize the customer onboarding process.",
},
],
stream: true,
});
for await (const chunk of stream) {
const content =
chunk.choices[0]?.delta?.content;
if (content) {
process.stdout.write(content);
}
}
process.stdout.write("n");
} catch (error) {
if (error instanceof OpenAI.APIError) {
console.error(
`API returned ${error.status}: ${error.message}`
);
} else {
console.error(error);
}
process.exitCode = 1;
}
Do not configure the OpenAI SDK for browser usage. Place the request in an application server, backend-for-frontend, serverless function, or another controlled server-side environment.
cURL Example
Use cURL to test the endpoint independently of an SDK. This helps determine whether a problem is caused by the API configuration or by client-specific validation.
Non-Streaming Request
curl --request POST
--url "https://app.customgpt.ai/api/v1/projects/${CUSTOMGPT_PROJECT_ID}/chat/completions"
--header "Authorization: Bearer ${CUSTOMGPT_API_KEY}"
--header "Content-Type: application/json"
--header "Accept: application/json"
--data '{
"model": "customgpt-agent",
"messages": [
{
"role": "system",
"content": "Answer using the connected knowledge base."
},
{
"role": "user",
"content": "What is our refund policy?"
}
],
"stream": false,
"is_inline_citation": true
}'
Streaming Request
curl --no-buffer
--request POST
--url "https://app.customgpt.ai/api/v1/projects/${CUSTOMGPT_PROJECT_ID}/chat/completions"
--header "Authorization: Bearer ${CUSTOMGPT_API_KEY}"
--header "Content-Type: application/json"
--header "Accept: text/event-stream"
--data '{
"model": "customgpt-agent",
"messages": [
{
"role": "user",
"content": "Summarize the onboarding process."
}
],
"stream": true,
"is_inline_citation": true
}'
A non-streaming response follows a Chat Completions-style structure:
{
"id": "completion-id",
"object": "chat.completion",
"created": 1780000000,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Answer based on the connected content."
},
"finish_reason": "stop"
}
]
}
Do not assume that a usage field will be present.
Environment-Variable Configuration
Environment-variable names are not universal across OpenAI-compatible tools. Whenever possible, use explicit application variables and construct the client configuration in code:
CUSTOMGPT_API_KEY=replace_with_your_key
CUSTOMGPT_PROJECT_ID=replace_with_your_project_id
Common configuration methods include:
| Client | Configuration method |
|---|---|
| OpenAI Python SDK | base_url |
| OpenAI Node.js SDK | baseURL |
| LangChain | base_url |
| Continue | apiBase |
| LiteLLM | api_base |
| Generic HTTP client | Complete endpoint URL |
Do not assume that historical variables such as OPENAI_API_BASE, OPENAI_BASE_URL, or another provider-specific variable will work in every tool.
Supported, Ignored, and Unsupported Fields
The compatibility endpoint supports a subset of the Chat Completions request structure. Some fields are accepted but ignored, while others are unsupported.
| Request field | Status | Behavior |
|---|---|---|
messages | Supported and required | Provides the conversation messages |
stream | Supported | Returns server-sent events when true |
stream_options | Supported | Controls documented streaming behavior |
model | Accepted but ignored | May be required by the client SDK |
temperature | Ignored | Does not control generation through this endpoint |
top_p | Ignored | No documented generation effect |
max_tokens | Ignored | Does not enforce an output-token limit |
max_completion_tokens | Ignored | No documented effect |
n | Ignored | Does not request multiple alternatives |
frequency_penalty | Ignored | No documented effect |
presence_penalty | Ignored | No documented effect |
stop | Ignored | No documented effect |
seed | Ignored | Does not provide deterministic generation |
logit_bias | Ignored | No documented effect |
logprobs | Ignored | Token log probabilities are not returned |
top_logprobs | Ignored | No documented effect |
user | Ignored | Does not authenticate or authorize application users |
metadata | Ignored | Not persisted through the compatibility format |
reasoning_effort | Ignored | No documented effect |
service_tier | Ignored | Does not select a service tier |
store | Ignored | Does not create OpenAI-style stored completions |
tools | Unsupported | Tool calling is not implemented |
tool_choice | Unsupported | Tool selection is not implemented |
parallel_tool_calls | Unsupported | Parallel tool calling is unavailable |
response_format | Unsupported | Structured outputs are not implemented |
web_search_options | Unsupported | Web search is unavailable |
modalities | Unsupported | Multimodal output is unavailable |
audio | Unsupported | Audio generation is unavailable |
is_inline_citation | CustomGPT.ai field | Requests inline source references |
lang | CustomGPT.ai field | Applies documented language behavior |
external_id | CustomGPT.ai field | Supplies a documented external identifier |
labels | CustomGPT.ai field | Applies configured labels |
labels_exclusive | CustomGPT.ai field | Controls documented label behavior |
sub_personas | CustomGPT.ai field | Applies configured sub-persona behavior |
When a client automatically sends unsupported fields, disable the corresponding feature or use a generic HTTP request instead of the client’s native OpenAI integration.
Which Tools Can Connect?
A tool should not be described as verified merely because it mentions OpenAI compatibility. Compatibility can change by tool version, SDK version, model-validation behavior, endpoint requirements, and automatically added request parameters.
Compatibility Statuses
- Verified: Confirmed through current CustomGPT.ai documentation or a working integration test.
- Configuration compatible: Official tool documentation confirms support for a configurable Chat Completions URL and API key.
- Adapter required: A generic HTTP node, proxy, middleware layer, or custom provider adapter is needed.
- Partially compatible: Basic text chat may work, but some required functionality is unavailable.
- Not currently verified: Public documentation is insufficient.
- Not compatible: The tool requires unsupported endpoints or hard-codes another provider.
Current Compatibility Catalog
Last reviewed: July 31, 2026
| Tool | Category | Status | Main configuration | Primary limitation |
|---|---|---|---|---|
| OpenAI Python SDK | Official SDK | Verified | base_url and API key | Only Chat Completions compatibility |
| OpenAI Node.js SDK | Official SDK | Configuration compatible | baseURL and API key | Must avoid unsupported OpenAI resources |
| LangChain OpenAI provider | Agent framework | Configuration compatible | base_url and api_key | Tools and structured output are unsupported |
| Continue | IDE assistant | Partially compatible | apiBase and useResponsesApi: false | Some features use the Responses API |
| Open WebUI | Chat interface | Partially compatible | Custom URL, key, and manual model ID | Automatic /models discovery may fail |
| LiteLLM | Proxy and router | Configuration compatible | api_base and API key | Must target Chat Completions only |
| Flowise ChatOpenAI | Visual builder | Configuration compatible | Custom base URL | Agent nodes may send tool fields |
| Langflow OpenAI Compatible provider | Visual builder | Not directly compatible | Requires provider discovery | Mandatory /v1/models validation |
| n8n HTTP Request node | Automation | Adapter required | Generic HTTP POST | Native OpenAI nodes may use other endpoints |
| Make HTTP module | Automation | Adapter required | Generic HTTP POST | Streaming support varies |
| Zapier Webhooks | Automation | Adapter required | Custom webhook request | Usually best for non-streaming requests |
| Custom server application | Application | Configuration compatible | Direct HTTP request | Developer owns state and security |
The catalog should be maintained with tool versions, verification evidence, limitations, and last-tested dates. Do not retain a “100+ verified tools” claim unless at least 100 currently active integrations have been reviewed against a documented inclusion standard.
LangChain Configuration
LangChain supports a configurable base URL for OpenAI Chat Completions-compatible providers.
from langchain.chat_models import init_chat_model
model = init_chat_model(
model="customgpt-agent",
model_provider="openai",
base_url=(
"https://app.customgpt.ai/api/v1/"
"projects/YOUR_PROJECT_ID/"
),
api_key="YOUR_CUSTOMGPT_API_KEY",
)
answer = model.invoke(
"Summarize our refund policy."
)
print(answer.content)
Use LangChain for basic text-chat workflows. Do not bind tools, request structured output, or depend on OpenAI token-usage metadata without testing the exact client version.
Continue Configuration
Continue supports an apiBase setting for OpenAI-compatible providers. Some configurations default to the OpenAI Responses API, so explicitly disable it.
name: CustomGPT Knowledge Assistant
version: 0.0.1
schema: v1
models:
- name: CustomGPT Agent
provider: openai
model: customgpt-agent
apiBase: https://app.customgpt.ai/api/v1/projects/YOUR_PROJECT_ID
apiKey: YOUR_CUSTOMGPT_API_KEY
useResponsesApi: false
Basic text chat is the intended use case. Tool calling, structured output, and Responses API features are unavailable through the compatibility endpoint.
Open WebUI Configuration
Open WebUI can connect to OpenAI-compatible providers, but it commonly verifies the provider through a /models request. Because the agent-specific compatibility endpoint does not expose that resource, a manual model configuration may be required.
- Open Admin Settings.
- Select Connections.
- Add an OpenAI-compatible connection.
- Enter the following URL:
https://app.customgpt.ai/api/v1/projects/YOUR_PROJECT_ID
- Enter the CustomGPT.ai API key.
- Add
customgpt-agentmanually as an allowed model ID. - Disable tools or structured-output features.
- Test a basic text request.
Treat this integration as partially compatible until it is tested against the exact Open WebUI release used in production.
How Citations and Sources Work
The compatibility request supports the CustomGPT.ai-specific is_inline_citation field.
{
"is_inline_citation": true
}
When enabled, source references may appear within the generated message content. Do not assume that the compatibility response includes a separate structured citation array.
For applications that require richer source metadata, source previews, or detailed conversation inspection, use the native CustomGPT.ai API.
Recommended source-rendering practices include:
- Preserve inline citation markers.
- Escape response HTML before rendering.
- Do not create clickable sources unless the application has verified source metadata.
- Make it clear when no citation is available.
- Avoid claiming that every answer includes a citation.
- Provide a fallback when a source cannot be displayed.
Streaming Responses
Set stream to true to receive server-sent events.
Each event is prefixed with data: and contains a Chat Completions-style chunk. Partial text is typically available under:
choices[0].delta.content
The stream ends with:
data: [DONE]
A production streaming client should:
- Handle partial UTF-8 content.
- Ignore empty deltas.
- Stop when
[DONE]is received. - Detect a connection that closes before completion.
- Apply an application-level timeout.
- Avoid silently restarting a partially displayed answer.
- Record stream failures without logging secrets.
- Test when inline source references appear during the stream.
Streaming behavior varies by SDK and user interface. Test the complete path from the API to the final application display.
Authentication and API-Key Security
CustomGPT.ai API requests use Bearer authentication over HTTPS:
Authorization: Bearer CUSTOMGPT_API_KEY
API keys should be created with the permissions required for the integration and no broader access than necessary.
Production security controls should include:
- Separate development and production keys
- Least-privilege permissions
- Expiration dates
- Scheduled rotation
- Immediate revocation procedures
- Server-side secret storage
- Source-control secret scanning
- Log redaction
- User-level authentication
- Authorization before selecting an agent
- Abuse and usage controls
The compatibility endpoint authenticates the application’s API request. It does not authenticate the end user of your application.
Compatibility Endpoint vs. Native CustomGPT.ai API
The compatibility endpoint is a convenience layer for reusing suitable OpenAI Chat Completions clients. It is not always the best option for a deeper production integration.
| Requirement | Compatibility endpoint | Native CustomGPT.ai API |
|---|---|---|
| Reuse an existing OpenAI SDK | Best fit | Additional integration work |
| Basic Chat Completions request | Supported | Uses native request structure |
| Fast proof of concept | Best fit | Possible with more setup |
| Native conversation management | Client-managed | Preferred |
| Files and richer message controls | Limited or unavailable | Preferred |
| CustomGPT.ai-specific metadata | Limited | Preferred |
| Tool calling | Not implemented | Verify relevant native capabilities |
| Structured output | Not implemented | Build with native or application controls |
| Advanced production integration | Evaluate carefully | Preferred |
Use the native API when the application requires:
- Durable conversation sessions
- Rich message metadata
- File operations
- Structured source workflows
- Deeper CustomGPT.ai controls
- Features that are not represented by Chat Completions
- A long-term integration designed around the CustomGPT.ai platform
Learn more about broader API integration options in the CustomGPT.ai API integration guide.
OpenAI-Compatible API vs. Hosted MCP
The compatibility API and the Model Context Protocol solve different problems.
The compatibility endpoint lets an existing Chat Completions client send a text request to a RAG-backed CustomGPT.ai agent.
MCP provides a standardized method for compatible agents and clients to discover and use tools or resources.
| Requirement | Compatibility API | Hosted MCP |
|---|---|---|
| Reuse an existing Chat Completions client | Strong fit | Not the primary purpose |
| Ask questions over approved content | Yes | Can expose relevant resources |
| Tool discovery | No | Core MCP capability |
| External actions | Not through this endpoint | Appropriate when exposed as MCP tools |
| Multi-tool agents | Client must orchestrate | Better fit for MCP-aware agents |
| Fast existing-SDK migration | Simpler | More architectural work |
| Best use case | RAG-backed chat requests | Standardized tool and resource access |
RAG grounds answers in retrieved knowledge. MCP helps agents discover or call external capabilities. One does not automatically replace the other.
Read the hosted MCP server guide for the complete architectural comparison.
Production Considerations
The compatibility endpoint is currently in Beta. Confirm the appropriate production architecture before making it a critical dependency.
Before deployment:
- Configure connection and response timeouts.
- Retry only appropriate failures.
- Use exponential backoff and jitter.
- Do not retry invalid credentials or unsupported requests.
- Rate-limit users in the application.
- Validate input size and format.
- Log status codes and request identifiers.
- Never log API keys.
- Test concurrent requests.
- Pin SDK versions.
- Review dependency upgrades before deployment.
- Monitor irrelevant or empty answers.
- Track knowledge-source processing and freshness.
- Provide a clear degraded-mode response.
- Test the absence of OpenAI-style usage fields.
- Maintain a migration path to the native API.
Do not publish unverified latency, throughput, uptime, or rate-limit figures.
For deeper architecture guidance, review the production RAG API guide.
Security and Enterprise Controls
CustomGPT.ai provides security and access capabilities for business and enterprise use. Availability can vary by plan and deployment requirements, so verify the current documentation before making implementation decisions.
Important controls may include:
- Scoped API-key permissions
- API-key expiration
- Agent-specific access
- Data-source controls
- Project isolation
- Encryption in transit and at rest
- Enterprise authentication options
- Compliance documentation
- Analytics and audit capabilities
The application developer remains responsible for protecting the surrounding application, authenticating users, enforcing authorization, validating input, and controlling which users can access each agent.
For sensitive workflows:
- Restrict connected sources.
- Prevent arbitrary project-ID selection.
- Apply human review where errors could create legal, financial, regulatory, or safety consequences.
- Review logging and retention requirements.
- Define an escalation process for uncertain or unsupported answers.
Common Errors and Troubleshooting
| Symptom | Likely cause | Resolution |
|---|---|---|
400 Bad Request | Invalid JSON or malformed message structure | Test the minimal cURL request and remove optional fields |
401 Unauthorized | Missing, expired, revoked, or invalid API key | Verify the Bearer header and key status |
404 Not Found | Incorrect project ID, path, or unsupported endpoint | Confirm the project ID and /chat/completions path |
429 Resource Exhausted | Usage or plan limit reached | Apply backoff and review current plan limits |
500 Internal Server Error | Service-side failure | Capture request details and retry carefully |
501 Unsupported Argument | Unsupported field sent | Remove tools, structured output, web search, or multimodal fields |
Client calls /models | Automatic model discovery | Add a model manually or use an adapter |
Client calls /responses | Responses API enabled | Force the client to use Chat Completions |
Client calls /assistants | Assistant-specific integration selected | Use a Chat Completions or generic HTTP operation |
| “Model not found” before the request | Local model validation | Use a configurable placeholder model |
| Empty response | Sources are not processed or application parsing failed | Inspect the complete raw response |
| Irrelevant answer | Missing or weak source coverage | Test a question directly answered by a connected source |
| Streaming parser fails | Incorrect SSE handling | Parse data: events and stop on [DONE] |
| Citations are missing | Inline citations not enabled or unavailable | Enable is_inline_citation or use native source metadata |
| Browser CORS error | Direct browser-side request | Move the request to a server-side proxy |
| API key exposed | Secret embedded in front-end code | Revoke the key and move the request server-side |
| Multi-turn context is lost | Previous messages were not resent | Include the required message history |
| Tool request fails | tools or tool_choice is present | Remove tool fields |
| Structured JSON request fails | response_format is present | Request text and validate the output in the application |
| Langflow validation fails | Mandatory /v1/models request | Use another client or a compatible proxy |
| Token usage is missing | Compatibility response omits usage data | Use available platform analytics or application metrics |
Developer Use Cases
Add business-document retrieval to an existing chat interface
An existing Python or Node.js chat application can replace its base URL and API key while continuing to use the Chat Completions request format. The selected CustomGPT.ai agent retrieves relevant information from connected policies, manuals, product documentation, or help-center content.
Use the native API when the application requires durable conversations, files, or structured source information.
Ground an IDE assistant in engineering documentation
A configurable IDE client can send developer questions to an agent connected to architecture documentation, internal standards, API references, and operational runbooks.
Use MCP when the assistant also needs access to repositories, ticketing systems, deployment tools, or other external actions.
Connect a voice interface to support content
A voice platform can convert speech to text, send the text to the compatibility endpoint, and convert the response back to speech.
An adapter may be required when the voice platform expects audio endpoints, tool calling, or a provider-specific request format.
Add RAG to an automation workflow
Automation platforms with generic HTTP modules can send questions to the complete CustomGPT.ai endpoint and pass the answer to another workflow step.
Use the native API when the workflow requires conversation state or richer message metadata.
Build an internal knowledge interface
An authenticated internal application can route employee questions to an agent grounded in approved company knowledge.
The application must enforce user authentication, agent authorization, and appropriate access controls.
Add source-grounded answers to a SaaS product
A SaaS application can call a client-specific or product-specific CustomGPT.ai agent from its backend. The application controls the user experience and access model while CustomGPT.ai handles retrieval over connected knowledge.
For deeper implementations, review the guide to building RAG applications with the OpenAI API.
Pricing and Plan Considerations
Before implementation, review the current CustomGPT.ai pricing and verify:
- API availability
- Usage allowances
- Agent limits
- Data-source limits
- Overage policies
- Rate limits
- Support levels
- Security features
- Trial availability
- Enterprise requirements
Do not rely on prices or limits copied from an older article or cached documentation.
Frequently Asked Questions
What is an OpenAI-compatible RAG API?
An OpenAI-compatible RAG API accepts a supported Chat Completions-style request while retrieving relevant information from connected knowledge sources before generating the answer. Compatibility refers to the request and response format, not support for every OpenAI endpoint or feature.
Can I use the OpenAI SDK with CustomGPT.ai?
Yes. The official OpenAI Python SDK is documented, and other OpenAI clients can work when they allow a custom base URL and API key. Use the u003ccodeu003echat.completionsu003c/codeu003e resource and verify that the client does not require unsupported endpoints.
Which OpenAI endpoint format does CustomGPT.ai support?
The compatibility layer supports:u003cbru003eu003ccodeu003ePOST /api/v1/projects/{projectId}/chat/completionsu003c/codeu003eu003cbru003eIt does not provide complete OpenAI API coverage.
Do I need to rewrite my existing OpenAI integration?
Not necessarily. A basic Chat Completions integration may require only a new base URL, API key, and project ID. More work is required when the application uses tools, structured output, model discovery, token-usage metadata, or unsupported endpoints.
Does CustomGPT.ai support streaming responses?
Yes. Set u003ccodeu003estreamu003c/codeu003e to u003ccodeu003etrueu003c/codeu003e to receive server-sent event chunks. The client should process partial deltas, handle interrupted streams, and stop when it receives u003ccodeu003e[DONE]u003c/codeu003e.
Is the u003ccodeu003emodelu003c/codeu003e parameter required?
Many OpenAI SDKs require a model string, but the compatibility endpoint currently ignores its value. Use a stable placeholder such as u003ccodeu003ecustomgpt-agentu003c/codeu003e.
Are all OpenAI request parameters supported?
No. Some fields are supported, many generation fields are ignored, and tools, structured outputs, web search, multimodal output, and audio are not implemented through the compatibility endpoint.
Can I connect LangChain to the CustomGPT.ai RAG API?
Yes, for basic Chat Completions workflows. Configure LangChain with the CustomGPT.ai base URL and API key. Do not depend on tools, structured output, or OpenAI token-usage metadata without testing.
Can I connect low-code tools to the API?
Yes. Use a generic server-side HTTP request module when the platform allows custom URLs, headers, and JSON bodies. Native OpenAI nodes may not work if they require unsupported OpenAI resources.
Does the API return citations?
The request supports u003ccodeu003eis_inline_citationu003c/codeu003e, which can include source markers in the generated message. Do not assume that the compatibility response contains a separate structured citation array.
When should I use the native CustomGPT.ai API?
Use the native API when the application requires deeper conversation management, file handling, richer metadata, structured source workflows, or CustomGPT.ai-specific platform controls.
What is the difference between the RAG API and MCP?
The RAG API sends chat requests to an agent grounded in approved content. MCP standardizes how compatible agents discover and use tools or resources. Use the compatibility API for existing Chat Completions clients and MCP for tool-oriented agent architectures.
How should I protect my CustomGPT.ai API key?
Store the key in a server-side secret manager or protected environment variable. Never expose it in browser code, public repositories, mobile packages, logs, or screenshots.
How do I troubleshoot an unsupported-parameter error?
Capture the exact outgoing JSON request and remove optional fields until a minimal request succeeds. Common causes include u003ccodeu003etoolsu003c/codeu003e, u003ccodeu003etool_choiceu003c/codeu003e, u003ccodeu003eresponse_formatu003c/codeu003e, web-search options, multimodal fields, and features automatically added by the client.
Start Building with the CustomGPT.ai RAG API
For a compatible Chat Completions client, begin with a minimal cURL request. Once the endpoint, project ID, API key, and connected knowledge have been validated, move the configuration into the SDK, framework, interface, or automation platform your application already uses.
Review the OpenAI-compatible RAG API overview, explore the CustomGPT.ai API documentation, or launch an implementation with the Developer Starter Kit.

Priyansh is a Developer Relations Advocate at CustomGPT.ai who writes deeply researched technical content on RAG APIs, AI agent development, and cloud-native tools.