Skip to content

Custom providers

Any platform with a custom-provider or bring-your-own-model form can point at DirectInference. What to enter in each field, what to leave blank, and how to confirm it’s live.

A provider form is really asking one question: what request shape will the tool send? Most forms labeled “custom provider” or “OpenAI-compatible” speak the OpenAI shape — pick that unless the tool explicitly offers the Anthropic or Gemini shape. Whichever dialect arrives, DirectInference serves it; you are choosing a wire format, not a model.

The form speaksBase URLCredential
OpenAI-compatible
”custom provider”, “OpenAI-compatible”, “bring your own model”
https://api.directinference.com/di/v1Authorization: Bearer llm_live_…
Anthropic Messages
”Anthropic provider”, “Messages API”
https://api.directinference.com/di
the client appends /v1/messages
x-api-key: llm_live_…
anthropic-version: 2023-06-01
Gemini
”Gemini provider”, “Google AI”
https://api.directinference.com/di
the client appends /v1beta/models/… itself; if the form’s base URL must already include /v1beta, enter …/di/v1beta
x-goog-api-key: llm_live_…
?key=llm_live_…
Authorization: Bearer llm_live_…

The whole configuration is two values: a base URL and a key you issue on the API Keys page. The only quirk is how much of the path the form builds itself — the base URL plus whatever the form appends must come out to https://api.directinference.com/di/v1/chat/completions. Pick the row that matches your form:

The form appendsEnter
/chat/completions
the most common convention
https://api.directinference.com/di/v1
/v1/chat/completionshttps://api.directinference.com/di
Nothing — it wants the full endpoint URLhttps://api.directinference.com/di/v1/chat/completions

The field’s placeholder or help text usually says which it is. If you can’t tell, start with …/di/v1 and move one path segment over if the first call returns a not-found error — at that point the key is never the problem. You can prove the pair from a terminal before fighting the form:

Terminal window
# Prove the base URL and key work before pasting them into a form
curl https://api.directinference.com/di/v1/chat/completions \
-H "Authorization: Bearer llm_live_..." \
-H "Content-Type: application/json" \
-d '{ "model": "di-fusion", "messages": [{ "role": "user", "content": "ping" }] }'

Everything else a provider form asks has a default answer. Fields that belong to other vendors’ account schemes stay empty:

FieldWhat to enter
Organization IDLeave blank — it belongs to another vendor’s account scheme.
Project IDLeave blank.
Deployment nameLeave blank.
API versionLeave blank — the version is already in the path. If an Anthropic-dialect form insists on a value, enter 2023-06-01.
Auth type / auth source / token prefixKeep the default. Standard Bearer (or the dialect’s native header) is exactly what DirectInference expects.

Capability checkboxes tell the tool which features to expose, not what the endpoint must do — answer generously:

The form asks aboutAnswerNotes
StreamingOnServer-sent events on every dialect; the OpenAI dialect terminates with a data: [DONE] sentinel.
Tool / function callingOnSupported on all three dialects.
Vision / image inputOnAn image in the request makes it a vision request, served accordingly.
PDF / document inputOnVia Anthropic-dialect document blocks; served as the document request type.
JSON mode / structured outputOnOpenAI response_format with json_schema; Anthropic output_config.format with type json_schema.
Prompt cachingOnSupported — see Prompt caching for the per-dialect details.

If the form has a custom-headers field, two optional headers are worth setting: X-Title with a name for the tool gives it its own line in per-application usage (Usage & analytics), and X-DI-Effort (fast, minimal, low, medium, high, xhigh, max — default auto) biases cost against quality for everything the tool sends (Effort).

Forms come in two kinds. Tools that auto-discover models list three entries — di-fusion (select it), plus di-saver and di-max, the same model with effort pinned for tools with fast/smart model slots. Tools that want a typed-in model name accept any string: use di-fusion, or keep the ids your team already has wired into saved prompts and pipelines. Every id resolves, nothing ever returns a not-found error, and the id you send is echoed back unchanged in the response.

Terminal window
curl https://api.directinference.com/di/v1/models \
-H "Authorization: Bearer llm_live_..."
# { "object": "list",
# "data": [ { "id": "di-fusion", "root": "di-fusion", ... },
# { "id": "di-saver", "root": "di-fusion", ... },
# { "id": "di-max", "root": "di-fusion", ... } ] }

Two common self-hosted chat UIs, end to end. Both speak the OpenAI dialect, so the base URL is https://api.directinference.com/di/v1 and the credential is a plain llm_live_… key — they auto-discover di-fusion, di-saver, and di-max.

In Admin Settings → Connections → OpenAI → Manage, click ➕ Add New Connection:

  • URLhttps://api.directinference.com/di/v1
  • API Keyllm_live_...

Save, then pick di-fusion from the model selector. Models are listed automatically from /models; no manual entry needed. Installing Open WebUI from scratch (Docker or pip) is covered step by step in the dedicated Open WebUI guide.

Three checks, strongest first:

  1. The model echo. The response’s model field is exactly the id you configured — nothing rewrites it (the Gemini dialect echoes it as modelVersion).
  2. The header. The response carries X-DI-Request-Type (pro, code, vision, document, long, json, reason, or flash). It is the only customer-readable response header, and its presence proves the request was served by DirectInference — see Response headers and Request types.
  3. The dashboard. The request shows up under Traces and Usage; with X-Title set, the tool becomes its own line in Applications.
Terminal window
# -D - dumps the response headers; the body is discarded
curl -s -o /dev/null -D - https://api.directinference.com/di/v1/chat/completions \
-H "Authorization: Bearer llm_live_..." \
-H "Content-Type: application/json" \
-d '{ "model": "di-fusion", "messages": [{ "role": "user", "content": "ping" }] }' \
| grep -i x-di-request-type
# x-di-request-type: pro
SymptomWhat’s happening — and the fix
The key test fails with another vendor’s errorThe base URL hasn’t been applied — the test ran against the tool’s default vendor. Save the base URL, then re-test; confirm the key with the curl above.
The first request returns a 404The form and the base URL are one path segment apart. Move between …/di, …/di/v1, and the full endpoint URL per the table above.
The model dropdown shows three entries — di-fusion, di-saver, di-maxExpected — that is the endpoint’s whole catalog: one model, with di-saver/di-max pinning effort. Select di-fusion unless you want the pin.
The tool’s per-model cost estimates look wrongThe tool prices by the model label it sees, which DirectInference only echoes. Actual spend lives in Usage & analytics and Spend & limits.
Responses arrive but nothing shows in TracesThe tool is still calling its previous provider — settings unsaved, or overridden per-model. Check a response from inside the tool for X-DI-Request-Type; if it is absent, re-save the provider settings.

Error envelope shapes and rate limits live in Errors & limits.