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.
What every integration comes down to
Section titled “What every integration comes down to”However different two agent frameworks look, onboarding either one is the same four moves:
- Pick the dialect the framework speaks — OpenAI, Anthropic, or Gemini — and use the matching base URL.
- Set the base URL and key. A config file, an environment variable, or a provider form — whichever the framework offers.
- Register the model ids. Use
di-fusion(anddi-saver/di-maxfor fast / smart slots). Frameworks that validate model names against a built-in list need the id added explicitly —di-fusionis on no vendor’s list. - Turn tools on. Enable the framework’s tool / function-calling switch so its agents can drive tool loops.
Base URL and key, per dialect
Section titled “Base URL and key, per dialect”| The framework speaks | Base URL | Credential |
|---|---|---|
| OpenAI-compatible | https://api.directinference.com/di/v1 | Authorization: Bearer llm_live_… |
| Anthropic Messages | https://api.directinference.com/di — the client appends /v1/messages | x-api-key: llm_live_… + anthropic-version: 2023-06-01 |
| Gemini | https://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.
Model ids are labels, not a menu
Section titled “Model ids are labels, not a menu”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.
Two capability switches to set by hand
Section titled “Two capability switches to set by hand”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:
- Model echo — a response’s
modelis exactly the id the framework sent (modelVersionon the Gemini dialect). - The header — responses carry
X-DI-Request-Type(pro,code,vision,document,long,json,reason, orflash); its presence is the proof DI served the request. See Response headers. - The dashboard — the call shows up in
Traces and Usage. Set
X-Titleon the provider and the framework gets its own line in Applications.
Supported agent frameworks
Section titled “Supported agent frameworks”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
Section titled “OpenClaw”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:
export DIRECTINFERENCE_API_KEY="llm_live_..." # provider id → <PROVIDER>_API_KEYopenclaw models list # confirms OpenClaw registered directinference/di-fusion from your configopenclaw models set directinference/di-fusionThe provider-scoped key env var is derived from the provider id
(directinference → DIRECTINFERENCE_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
Section titled “Hermes Agent”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 modelPut the key in ~/.hermes/.env (or export it) and confirm with a scripted
one-shot:
export DIRECTINFERENCE_API_KEY="llm_live_..."hermes -z "Reply with exactly: PONG" # one-shot: prompt in, final answer text outNemoClaw
Section titled “NemoClaw”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.
openshell provider create \ --name directinference \ --type openai \ --credential OPENAI_API_KEY="$LLM_API_KEY" \ --config OPENAI_BASE_URL=https://api.directinference.com/di/v1nemoclaw inference set # select the directinference provider + a model id (e.g. di-fusion)Odysseus
Section titled “Odysseus”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:
git clone https://github.com/pewdiepie-archdaemon/odysseus.gitcd odysseus && cp .env.example .env && docker compose up -d --build# http://localhost:7000 — first admin password: docker compose logs odysseus- Settings → Providers → add a custom OpenAI-compatible provider.
- Base URL —
https://api.directinference.com/di/v1(keep the/v1). - API key —
llm_live_.... - Model — Odysseus probes
/di/v1/modelsto fill the picker; choosedi-fusion, or type any id (di-saver/di-maxpin effort).