Developer API

One endpoint. Every provider.

DalimServer exposes a fully OpenAI-compatible API. Point your existing SDK here, swap the base URL, and keep using the models you already know.

Base URL
Send all requests to this endpoint.
HTTPS
https://dalimserver.lovable.app/v1

Authentication

Every request must include your Master API key in the Authorization header.

Header
Authorization: Bearer YOUR_MASTER_KEY

Never expose your master key in client-side code or public repositories. Use it from your backend or a secure environment.

Supported endpoints

POST
/v1/chat/completions

Chat completions with streaming support.

GET
/v1/models

List models available to your master key.

POST
/v1/completions

Legacy completions (provider-dependent).

POST
/v1/embeddings

Embeddings (if allowed by your key).

Code examples

cURL
curl -X POST "https://dalimserver.lovable.app/v1/chat/completions" \
  -H "Authorization: Bearer YOUR_MASTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Provider routing

By default DalimServer picks the best available upstream key for the requested model. You can also force a specific provider by prefixing the model name.

Prefix routing
Request body
{
  "model": "groq/llama-3.1-8b-instant",
  "messages": [{"role": "user", "content": "Hi!"}]
}

Use provider/model to force a provider.

Dalim branded models
Request body
{
  "model": "dalim-2.0",
  "messages": [{"role": "user", "content": "Explain quantum computing"}]
}

Custom slugs configured by the admin in the dashboard.

Supported prefixes include openai/, groq/, cerebras/, openrouter/, deepseek/, mistral/, anthropic/, xai/, google/, yunwu/ and more.

Model allowlist & auto mode

Admins can restrict which models each master key may call. If a model is blocked, the proxy returns a clear 400 error. The special auto model lets DalimServer pick the smallest/fastest allowed model for you.

Auto model
{
  "model": "auto",
  "messages": [{"role": "user", "content": "Summarize this in one sentence."}]
}

Error codes

CodeMeaning
401Missing or invalid master key.
403IP not in allowlist or action forbidden.
404Model or upstream path not found.
429Rate limit, token limit, or monthly spend cap reached.
402All upstream keys exhausted for this model/provider.
500Gateway or upstream error after retries.

Streaming

Set stream: true to receive Server-Sent Events just like OpenAI. The gateway forwards chunks from the selected upstream provider transparently.

Streaming request
{
  "model": "gpt-4o-mini",
  "messages": [{"role": "user", "content": "Count to 10"}],
  "stream": true
}