Skip to content

Agent frameworks

Standalone agent platforms — the self-hosted gateways and autonomous agent runtimes you install and point at a model — work with DirectInference the same way everything else does: give the framework DI’s base URL and an llm_live_… key, keep your model ids, and every request its agents make is served by DirectInference.

However different two agent frameworks look, onboarding either one is the same four moves:

  1. Pick the dialect the framework speaks — OpenAI, Anthropic, or Gemini — and use the matching base URL.
  2. Set the base URL and key. A config file, an environment variable, or a provider form — whichever the framework offers.
  3. Register the model ids. Use di-fusion (and di-saver / di-max for fast / smart slots). Frameworks that validate model names against a built-in list need the id added explicitly — di-fusion is on no vendor’s list.
  4. Turn tools on. Enable the framework’s tool / function-calling switch so its agents can drive tool loops.
The framework speaksBase URLCredential
OpenAI-compatiblehttps://api.directinference.com/di/v1Authorization: Bearer llm_live_…
Anthropic Messageshttps://api.directinference.com/di
— the client appends /v1/messages
x-api-key: llm_live_… + anthropic-version: 2023-06-01
Geminihttps://api.directinference.com/di
— the client appends /v1beta/models/…
x-goog-api-key: / ?key= / Authorization: Bearer

The per-surface auth details are in Authentication; the full client-by-client base-URL table is in Migrate to DirectInference.

There is one model. Send di-fusion, or keep whatever id the framework already uses — every id resolves, nothing 404s, and the id is echoed back unchanged. Map an agent’s fast / smart model slots to di-saver and di-max: the same model with effort pinned low and high. Never surface a model picker to the framework’s users — there is no model to choose, and request handling is automatic.

The OpenAI Responses API is served too (statelessly, at /v1/responses), so agents built on it — including the OpenAI Agents SDK’s default surface — work unchanged. The one abstraction DirectInference does not serve is provider server-side tools (web search, code execution, URL context, and the Responses hosted tools): keep those call sites on the original provider. They fail with a clear error at request time, never a silent wrong answer. The full served / not-served list is in Capabilities.

Confirm an agent is running on DirectInference

Section titled “Confirm an agent is running on DirectInference”

The same three checks regardless of framework, strongest first:

  1. Model echo — a response’s model is exactly the id the framework sent (modelVersion on the Gemini dialect).
  2. The header — responses carry X-DI-Request-Type (pro, code, vision, document, long, json, reason, or flash); its presence is the proof DI served the request. See Response headers.
  3. The dashboard — the call shows up in Traces and Usage. Set X-Title on the provider and the framework gets its own line in Applications.

Worked, end-to-end setups. More are added over time — any OpenAI-, Anthropic-, or Gemini-compatible agent platform already works with the four moves above even before it appears here.

OpenClaw is a self-hosted gateway that connects chat surfaces (Slack, Telegram, Discord, WhatsApp, …) to a single embedded agent runtime. It is model-agnostic, so DirectInference plugs in as a custom openai-completions provider in ~/.openclaw/openclaw.json (JSON5).

{
models: {
providers: {
directinference: {
baseUrl: "https://api.directinference.com/di/v1",
apiKey: "${DIRECTINFERENCE_API_KEY}", // env substitution — never inline a key
api: "openai-completions",
models: [
{ id: "di-fusion", name: "DirectInference", input: ["text", "image"] },
{ id: "di-saver", name: "DirectInference Saver", input: ["text", "image"] },
{ id: "di-max", name: "DirectInference Max", input: ["text", "image"] },
],
},
},
},
agents: {
defaults: {
// string form sets the primary; object form adds fallbacks:
// model: { primary: "directinference/di-fusion", fallbacks: ["directinference/di-saver"] }
model: "directinference/di-fusion",
},
},
}

Then provide the key and point the agent at DI:

Terminal window
export DIRECTINFERENCE_API_KEY="llm_live_..." # provider id → <PROVIDER>_API_KEY
openclaw models list # confirms OpenClaw registered directinference/di-fusion from your config
openclaw models set directinference/di-fusion

The provider-scoped key env var is derived from the provider id (directinferenceDIRECTINFERENCE_API_KEY, or the top-priority OPENCLAW_LIVE_DIRECTINFERENCE_KEY). Every channel wired to the gateway now runs its agent on DirectInference.

Prefer to have an agent do it? The installable DirectInference skill includes an OpenClaw flow — ask your coding agent to “set up OpenClaw on DirectInference” and it writes the provider block and verifies the connection for you.

Hermes Agent (Nous Research) is a self-hosted, self-improving autonomous agent — persistent memory, learned skills, terminal / file / web tools, MCP, and scheduled work. It is model-agnostic and OpenAI-compatible, so DirectInference goes in as a custom provider in ~/.hermes/config.yaml. Use the named custom_providers form with key_env so the key stays out of the file:

custom_providers:
- name: directinference
base_url: https://api.directinference.com/di/v1 # keep the /v1
key_env: DIRECTINFERENCE_API_KEY # env var that holds the key
model:
default: di-fusion # any id; sent straight to DI, echoed back
provider: custom:directinference # use the named provider above
supports_vision: true # DI routes image requests to a vision model

Put the key in ~/.hermes/.env (or export it) and confirm with a scripted one-shot:

Terminal window
export DIRECTINFERENCE_API_KEY="llm_live_..."
hermes -z "Reply with exactly: PONG" # one-shot: prompt in, final answer text out

NemoClaw is NVIDIA’s open-source secure runtime: it runs agents like OpenClaw and Hermes (both above) inside an OpenShell sandbox with policy-based egress control and managed inference. You wire DirectInference in at the inference-provider level — the gateway holds the key and forwards agent traffic to DI, so the credential never enters the sandbox.

Terminal window
openshell provider create \
--name directinference \
--type openai \
--credential OPENAI_API_KEY="$LLM_API_KEY" \
--config OPENAI_BASE_URL=https://api.directinference.com/di/v1
nemoclaw inference set # select the directinference provider + a model id (e.g. di-fusion)

Odysseus is a self-hosted, privacy-first AI workspace (FastAPI) — chat, agents, deep research, documents, notes, and tools — that connects to any OpenAI-compatible API. Run it, then add DirectInference as a provider in the app:

Terminal window
git clone https://github.com/pewdiepie-archdaemon/odysseus.git
cd odysseus && cp .env.example .env && docker compose up -d --build
# http://localhost:7000 — first admin password: docker compose logs odysseus
  1. Settings → Providers → add a custom OpenAI-compatible provider.
  2. Base URLhttps://api.directinference.com/di/v1 (keep the /v1).
  3. API keyllm_live_....
  4. Model — Odysseus probes /di/v1/models to fill the picker; choose di-fusion, or type any id (di-saver / di-max pin effort).