Skip to Content
kosemdocs
GuidesLLM GatewayProviders

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

  1. In your organization, click LLM Gateway, then Providers, then Add a provider.
  2. Under Compatible APIs, click the API the server speaks: OpenAI-compatible Chat Completions, OpenAI-compatible Responses or Anthropic-compatible API.
  3. Enter its Base URL: for OpenAI APIs, enter the URL prefix before /chat/completions, /responses and /models (such as https://llm.example.com/v1); for Anthropic APIs, enter the prefix before /v1/messages (such as https://llm.example.com/anthropic).
  4. 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-compatible or providerTypes/anthropic-compatible, with the base URL as base_url in config.
  • 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-Key for Anthropic-compatible servers). On OpenAI APIs, kosem verifies the key with GET 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:

  1. Add the built-in provider: Add a provider.
  2. Rename the old model's alias (such as deepseek to deepseek-old): click Edit beside an organization model, or update a project model with the API (PATCH /v1/projects/{project}/models/{model}).
  3. Add the model under the new provider using the original alias.
  4. Delete the old model, then delete the old provider once no models use it.

On this page