Compatible servers
Add a server that speaks OpenAI's or Anthropic's API at a custom base URL, such as a self-hosted model, as a provider on any plan.
Connect a server that implements OpenAI's Chat Completions or Responses API, or Anthropic's Messages API, at a custom base URL (such as a self-hosted model or an internal proxy). Adding a provider requires Owner or LLM Gateway Admin on the organization, or on a project for a project-scoped provider. Compatible servers are available on every plan within your provider quota (Limits and quotas).
For DeepSeek, Kimi, Z.ai and Alibaba Cloud Model Studio, use their built-in providers instead (Add a provider).
Add a compatible server
- In your organization, click LLM Gateway, then Providers, then Add a provider.
- Under Compatible APIs, click the API the server speaks: OpenAI-compatible Chat Completions, OpenAI-compatible Responses or Anthropic-compatible API.
- Enter its Base URL: for OpenAI APIs, enter the URL prefix before
/chat/completions,/responsesand/models(such ashttps://llm.example.com/v1); for Anthropic APIs, enter the prefix before/v1/messages(such ashttps://llm.example.com/anthropic). - Paste the server's key into API key, select which projects can create models with this provider, click Test and click Add provider.
See Add a provider for adding a project provider, sharing and key rotation.
What kosem uses
- Types, for the API:
providerTypes/openai-compatible,providerTypes/openai-responses-compatibleorproviderTypes/anthropic-compatible, with the base URL asbase_urlinconfig. - Base URL requirements: must start with
https://and resolve to a public address, with no username, password, query string or fragment. kosem doesn't follow redirects and sends the key only to that host. - Authentication and checks: kosem sends the key as a bearer token (and also in
X-Api-Keyfor Anthropic-compatible servers). On OpenAI APIs, kosem verifies the key withGET models; on Anthropic APIs, kosem sends an empty message request that the server rejects without invoking a model. - Models: listed from
GET models. If the server doesn't return a model list, click Add by ID and enter the model ID. - Strict tools: on Anthropic-compatible servers, this setting is off by default. Turn it on for servers that support Anthropic's strict tool schema, such as Claude proxies.
Price its models
A compatible server sets its own prices, so kosem records its requests with no cost. To count them in usage and spend limits, give the model a price: match a catalog model kosem knows, as below, or set custom prices per million tokens as input and output.
export KOSEM_API_KEY='kosem_sk_…'
export KOSEM_MODEL='projects/prj_01m5r9dh9mf0ps98ktkap3562c/models/mdl_01m5rb2x9ke4vbt6g0d4x7qz1k'
curl -s -X PATCH "https://api.kosem.ai/v1/$KOSEM_MODEL" \
-H "Authorization: Bearer $KOSEM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"pricing": {"pricedLike": {"provider": "providers/openai", "providerModel": "gpt-5-mini"}}}'Move a model to its maker's provider
DeepSeek, Kimi, GLM or Qwen models added through an OpenAI-compatible Chat Completions provider have no built-in pricing, and DeepSeek and Kimi reject agent requests after tool calls. To migrate to the built-in provider while keeping the same alias:
- Add the built-in provider: Add a provider.
- Rename the old model's alias (such as
deepseektodeepseek-old): click Edit beside an organization model, or update a project model with the API (PATCH /v1/projects/{project}/models/{model}). - Add the model under the new provider using the original alias.
- Delete the old model, then delete the old provider once no models use it.