Connect a custom OpenAI-compatible server
This guide shows how to connect a model from any provider or server that uses the OpenAI API format, so your tenant can use it in Chat and through the platform API, the same way as the platform's own models.
Use it when the model isn't from OpenAI, Azure OpenAI or Anthropic, but its server accepts OpenAI-style requests, for example a hosted provider such as Mistral, Groq or Together AI, or a self-hosted server such as vLLM or Ollama.
Before you start
- The Editor or Owner role in your tenant. See Roles in a tenant.
- These values from your provider's documentation or account:
- Base URL: the server's address without
/v1, such ashttps://api.mistral.ai. - API key for the server.
- Model ID exactly as the provider spells it, such as
mistral-large-latest.
- Base URL: the server's address without
- A server the platform can reach. The platform calls the server, not your browser. A self-hosted server needs
an address the platform's network can reach.
localhostdoesn't work.
The platform adds /v1/... to the Base URL itself. If you enter https://api.mistral.ai/v1, requests go to
.../v1/v1/chat/completions and fail.
Connect to a custom OpenAI-compatible server
-
In the sidebar of the CM portal, go to Models → External Models → Connect external model.
-
Fill in the form:
Field Enter Example Provider Custom OpenAI-compatible — Provider model ID The model ID exactly as the provider spells it. It can't be changed later. mistral-large-latestAPI key Your provider key sk-...Base URL The server's address, without /v1or any other path.http://works for a server inside your network.https://api.mistral.aiAPI model id The name your apps use to call the model. It copies Provider model ID until you edit it. It must be unique on the platform and can't be changed later. mistral-largeDisplay name The name people see in the portal and in Chat Mistral LargeModel type Chat, Embedding, Reranker, OCR, Transcription, Guardrail or Decision. Choosing it ticks the matching modalities. See Choose the model type and modalities. Chat Input modalities What the model accepts. Keep the ticked ones and add any the model also supports. See Choose the model type and modalities. Text Output modalities What the model returns. Keep the ticked ones. See Choose the model type and modalities. Text Context length The model's maximum tokens per request. Optional, but most servers don't report it, and apps and Chat use it to size prompts. 128000 -
Select Connect model. The model appears on the External Models tab.
-
Share it. Right now only you and the tenant's Owners can use it. Open the model, go to the Users tab and share it with the people, groups or whole tenant that should use it. See Share a resource.
Connect model saves the form without contacting the server. If a value is wrong, you only find out when the first request fails, so test the model to verify it works.
Server paths the platform calls
The platform calls these paths on your Base URL, so your server must offer the ones for the model type you choose:
| Model type | Path |
|---|---|
| Chat | /v1/responses from Chat, /v1/chat/completions from code |
| Embedding | /v1/embeddings |
| Reranker | /rerank |
| OCR | /v1/chat/completions |
| Transcription | /v1/audio/transcriptions |
| Guardrail | /v1/responses |
| Decision | /v1/systemone |
Test it
In Chat: select Open chat in the sidebar, pick your model and send a message.
From code:
-
Open the model and copy its full API model id. The platform puts your tenant's name in front of the id you entered, so
mistral-largebecomes something likeacme/mistral-large. -
On the same page, select Create API key. It opens the key form with this model already granted.
-
Copy the API URL from the bottom of the sidebar, then call the model:
curl "<API URL>/v1/chat/completions" \-H "Authorization: Bearer <your platform API key>" \-H "Content-Type: application/json" \-d '{"model": "acme/mistral-large", "messages": [{"role": "user", "content": "Hello"}]}'Use your platform API key, not the provider's key.
Test both. Chat uses your server's /v1/responses, and the curl call above uses /v1/chat/completions. Many
OpenAI-compatible servers offer only the second, so the model can work from code but fail in Chat.
Good to know
- Which APIs work: Responses, Chat Completions, Embeddings, Rerank and Audio
transcriptions, as long as your server offers the matching path. The Messages API also works
through your server's
/v1/responses. - Tool calling is limited on the Responses API.
tool_choicecan only beautoornone. - The provider bills usage, unless the server is self-hosted. The platform also counts the tokens in your tenant's usage.
- Prompts are sent to that server. Make sure it meets your organization's data policy.
Troubleshooting
| Problem | What to check |
|---|---|
Every request fails with 404 | Base URL has no /v1 or other path at the end. |
| Calls from code work, but Chat fails | Your server must offer /v1/responses. If it only offers /v1/chat/completions, use the model from code. |
| Requests fail with "model not found" from the server | Provider model ID is spelled exactly as the provider lists it. It can't be edited, so connect the model again with the right ID. |
| Every request fails with an authentication error | The API key is valid for this server. |
| Connection errors or timeouts | The server is running and reachable from the platform's network. localhost doesn't work. |
| Connect model fails because the id is taken | Another model, alias or preset agent already uses that API model id. Choose a unique one. |
| The model works for you but others can't see it | Share it on the model's Users tab. |
| The model is missing from Chat | Model type is Chat, and the model is shared with you. |
A call from code returns 404 with model "..." not found or not ready | Set model to the full API model id, with your tenant's name in front. |
| A call from code is refused with a permission error | The API key is granted this model. Create one from the model's page with Create API key. |