Send a message to a conversation within an agent (formerly known as project) identified by its unique projectId and sessionId. This endpoint enables you to send a new message to a specific conversation, facilitating seamless communication and collaboration within the agent. By providing the projectId and sessionId, you can target the desired conversation and contribute to the ongoing discussion. This API endpoint supports real-time streaming, allowing for instant message delivery and dynamic updates which enables efficient and interactive communication between the user and agent. Here is an example to send a message to a conversation: API SDK.
Purpose
Send a message to a conversation within an agent (formerly known as project) identified by its unique projectId and sessionId.
This endpoint enables you to send a new message to a specific conversation, facilitating seamless communication and collaboration within the agent.
By providing the projectId and sessionId, you can target the desired conversation and contribute to the ongoing discussion.
This API endpoint supports real-time streaming, allowing for instant message delivery and dynamic updates which enables efficient and interactive communication between the user and agent.
Here is an example to send a message to a conversation: API SDK.
Conceptually, this is the OpenAI‑style chat surface for your agent: you send messages[] and the platform handles retrieval‑augmented generation over the agent’s knowledge base, optionally with streaming and inline citations.
At a high level, this is the canonical way to work with conversations and messages between users and the agent via the CustomGPT API.
When to use
- When you need to send a message to a conversation in openai format as part of your backend or automation workflows.
- When you already use the OpenAI Chat Completions API format and want to drop CustomGPT in as a RAG‑backed replacement with minimal client changes.
- For server‑side integrations where you prefer JSON bodies over multipart form‑data and want easy support for
streamand inline citations.
Example usage CURL (create a new conversation and send a message to it using a single curl command (in OpenAI style).
curl -X POST "https://app.customgpt.ai/api/v1/projects/12345/chat/completions" \
-H "Authorization: Bearer API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "Hi there, start a new chat please!"}],"model": "gpt-4-o", "stream": false, "lang": "en"}'Note: The model key will be ignored.
