# Custom endpoints

> Connect any OpenAI-compatible server to ACOG: Ollama, vLLM, llama.cpp, DeepSeek, or a gateway of your own.

Product: AI Cost Optimizer Gateway (ACOG). Web version: https://tessarac.com/docs/acog/providers/custom-endpoints. Last updated: 2026-10-16.

A custom connection sends requests to any server that implements the OpenAI Chat Completions API: a model server you run (Ollama, vLLM, llama.cpp), an inference vendor (DeepSeek and others) or another gateway.

## Connect

1. In ACOG, open **Admin → Providers → Connect provider** and choose **Custom**.
2. Enter:

| Field | Notes |
|---|---|
| Base URL | The server's base, without `/v1`. ACOG calls `{base URL}/v1/chat/completions`. |
| API key | Optional. Sent as `Authorization: Bearer`. Leave it empty for a server with no authentication. |
| Server type | `generic`, `deepseek`, `ollama`, `qwen` or `vllm`. It tells ACOG how the server handles prompt caching. |
| Label | Optional display name |
| API version | Optional. Appended as `api-version` for servers that need it. |

3. Declare the models the server serves, exactly as it names them (for example `llama3.3:70b`), and choose a default.

## Where the server can be

| Deployment | Allowed addresses |
|---|---|
| Hosted | A public HTTPS address on port 443. Private, LAN and loopback addresses, other ports and `http://` are refused. |
| Self-hosted | Any address you configure, including `http://` and private networks |

To use a server on your own network with the hosted service, publish it at a public HTTPS address you control, protected by its API key.

## Calling a custom endpoint through ACOG

Use the [Chat Completions API](https://tessarac.com/docs/acog/api/chat-completions.md), or the [Messages API](https://tessarac.com/docs/acog/api/messages.md) which ACOG translates. The OpenAI-compatible [Embeddings API](https://tessarac.com/docs/acog/api/embeddings.md) works if your server implements `/v1/embeddings`. The native route is `https://gateway.acog.tessarac.com/custom`.

The savings mechanisms apply to custom connections as to any other: the response cache, de-duplication and the semantic cache work regardless of the server.
