CustomGPT.ai Blog

Connect OpenAI-Compatible Tools to CustomGPT.ai’s RAG API

Author Image

Written by: Priyansh Khodiyar

·

23 min read

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 configurationCustomGPT.ai configuration
OpenAI API keyCustomGPT.ai API key
OpenAI API endpointAgent-specific CustomGPT.ai endpoint
Generic model knowledgeKnowledge retrieved from approved business content
Existing SDK or clientRetained when compatible

The three primary changes are:

  1. Replace the existing API key with a CustomGPT.ai API key.
  2. Replace the API base URL with the agent-specific CustomGPT.ai URL.
  3. 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:

  1. Uses the Chat Completions request format.
  2. Allows a custom API base URL.
  3. Allows a custom Bearer API key.
  4. Can target an agent-specific endpoint.
  5. Does not require unsupported OpenAI endpoints.
  6. 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:

  • model
  • messages
  • stream

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:

ClientConfiguration method
OpenAI Python SDKbase_url
OpenAI Node.js SDKbaseURL
LangChainbase_url
ContinueapiBase
LiteLLMapi_base
Generic HTTP clientComplete 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 fieldStatusBehavior
messagesSupported and requiredProvides the conversation messages
streamSupportedReturns server-sent events when true
stream_optionsSupportedControls documented streaming behavior
modelAccepted but ignoredMay be required by the client SDK
temperatureIgnoredDoes not control generation through this endpoint
top_pIgnoredNo documented generation effect
max_tokensIgnoredDoes not enforce an output-token limit
max_completion_tokensIgnoredNo documented effect
nIgnoredDoes not request multiple alternatives
frequency_penaltyIgnoredNo documented effect
presence_penaltyIgnoredNo documented effect
stopIgnoredNo documented effect
seedIgnoredDoes not provide deterministic generation
logit_biasIgnoredNo documented effect
logprobsIgnoredToken log probabilities are not returned
top_logprobsIgnoredNo documented effect
userIgnoredDoes not authenticate or authorize application users
metadataIgnoredNot persisted through the compatibility format
reasoning_effortIgnoredNo documented effect
service_tierIgnoredDoes not select a service tier
storeIgnoredDoes not create OpenAI-style stored completions
toolsUnsupportedTool calling is not implemented
tool_choiceUnsupportedTool selection is not implemented
parallel_tool_callsUnsupportedParallel tool calling is unavailable
response_formatUnsupportedStructured outputs are not implemented
web_search_optionsUnsupportedWeb search is unavailable
modalitiesUnsupportedMultimodal output is unavailable
audioUnsupportedAudio generation is unavailable
is_inline_citationCustomGPT.ai fieldRequests inline source references
langCustomGPT.ai fieldApplies documented language behavior
external_idCustomGPT.ai fieldSupplies a documented external identifier
labelsCustomGPT.ai fieldApplies configured labels
labels_exclusiveCustomGPT.ai fieldControls documented label behavior
sub_personasCustomGPT.ai fieldApplies 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

ToolCategoryStatusMain configurationPrimary limitation
OpenAI Python SDKOfficial SDKVerifiedbase_url and API keyOnly Chat Completions compatibility
OpenAI Node.js SDKOfficial SDKConfiguration compatiblebaseURL and API keyMust avoid unsupported OpenAI resources
LangChain OpenAI providerAgent frameworkConfiguration compatiblebase_url and api_keyTools and structured output are unsupported
ContinueIDE assistantPartially compatibleapiBase and useResponsesApi: falseSome features use the Responses API
Open WebUIChat interfacePartially compatibleCustom URL, key, and manual model IDAutomatic /models discovery may fail
LiteLLMProxy and routerConfiguration compatibleapi_base and API keyMust target Chat Completions only
Flowise ChatOpenAIVisual builderConfiguration compatibleCustom base URLAgent nodes may send tool fields
Langflow OpenAI Compatible providerVisual builderNot directly compatibleRequires provider discoveryMandatory /v1/models validation
n8n HTTP Request nodeAutomationAdapter requiredGeneric HTTP POSTNative OpenAI nodes may use other endpoints
Make HTTP moduleAutomationAdapter requiredGeneric HTTP POSTStreaming support varies
Zapier WebhooksAutomationAdapter requiredCustom webhook requestUsually best for non-streaming requests
Custom server applicationApplicationConfiguration compatibleDirect HTTP requestDeveloper 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.

  1. Open Admin Settings.
  2. Select Connections.
  3. Add an OpenAI-compatible connection.
  4. Enter the following URL:
https://app.customgpt.ai/api/v1/projects/YOUR_PROJECT_ID
  1. Enter the CustomGPT.ai API key.
  2. Add customgpt-agent manually as an allowed model ID.
  3. Disable tools or structured-output features.
  4. 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:

  1. Handle partial UTF-8 content.
  2. Ignore empty deltas.
  3. Stop when [DONE] is received.
  4. Detect a connection that closes before completion.
  5. Apply an application-level timeout.
  6. Avoid silently restarting a partially displayed answer.
  7. Record stream failures without logging secrets.
  8. 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.

RequirementCompatibility endpointNative CustomGPT.ai API
Reuse an existing OpenAI SDKBest fitAdditional integration work
Basic Chat Completions requestSupportedUses native request structure
Fast proof of conceptBest fitPossible with more setup
Native conversation managementClient-managedPreferred
Files and richer message controlsLimited or unavailablePreferred
CustomGPT.ai-specific metadataLimitedPreferred
Tool callingNot implementedVerify relevant native capabilities
Structured outputNot implementedBuild with native or application controls
Advanced production integrationEvaluate carefullyPreferred

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.

RequirementCompatibility APIHosted MCP
Reuse an existing Chat Completions clientStrong fitNot the primary purpose
Ask questions over approved contentYesCan expose relevant resources
Tool discoveryNoCore MCP capability
External actionsNot through this endpointAppropriate when exposed as MCP tools
Multi-tool agentsClient must orchestrateBetter fit for MCP-aware agents
Fast existing-SDK migrationSimplerMore architectural work
Best use caseRAG-backed chat requestsStandardized 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

SymptomLikely causeResolution
400 Bad RequestInvalid JSON or malformed message structureTest the minimal cURL request and remove optional fields
401 UnauthorizedMissing, expired, revoked, or invalid API keyVerify the Bearer header and key status
404 Not FoundIncorrect project ID, path, or unsupported endpointConfirm the project ID and /chat/completions path
429 Resource ExhaustedUsage or plan limit reachedApply backoff and review current plan limits
500 Internal Server ErrorService-side failureCapture request details and retry carefully
501 Unsupported ArgumentUnsupported field sentRemove tools, structured output, web search, or multimodal fields
Client calls /modelsAutomatic model discoveryAdd a model manually or use an adapter
Client calls /responsesResponses API enabledForce the client to use Chat Completions
Client calls /assistantsAssistant-specific integration selectedUse a Chat Completions or generic HTTP operation
“Model not found” before the requestLocal model validationUse a configurable placeholder model
Empty responseSources are not processed or application parsing failedInspect the complete raw response
Irrelevant answerMissing or weak source coverageTest a question directly answered by a connected source
Streaming parser failsIncorrect SSE handlingParse data: events and stop on [DONE]
Citations are missingInline citations not enabled or unavailableEnable is_inline_citation or use native source metadata
Browser CORS errorDirect browser-side requestMove the request to a server-side proxy
API key exposedSecret embedded in front-end codeRevoke the key and move the request server-side
Multi-turn context is lostPrevious messages were not resentInclude the required message history
Tool request failstools or tool_choice is presentRemove tool fields
Structured JSON request failsresponse_format is presentRequest text and validate the output in the application
Langflow validation failsMandatory /v1/models requestUse another client or a compatible proxy
Token usage is missingCompatibility response omits usage dataUse 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.

Build an AI Agent for Your Business in Minutes

From one sentence to a working AI agent. Type what you need and try it live. No signup.

Build AI agents from your content, in minutes!