DeepInfra Provider Setup for OpenClaw
Learn how to connect DeepInfra to OpenClaw using its OpenAI-compatible endpoint and a single API key. This page covers plugin installation, key creation, CLI setup, config snippets, and supported surfaces.
Read this when
- You want a single API key for the top open source LLMs
- You want to run models via DeepInfra's API in OpenClaw
DeepInfra serves both frontier and widely used open source models through one OpenAI-compatible endpoint secured by a single API key. In most cases, pointing an OpenAI SDK at a different base URL is all that is needed to use it.
Install plugin
openclaw plugins install @openclaw/deepinfra-provider
When a Gateway is already running, the installation is picked up automatically; if not, it applies at the next startup. See Apply changes and inspect.
Get an API key
- Log in at deepinfra.com
- Open Dashboard / Keys and create a key, or reuse the one generated for you
CLI setup
openclaw onboard --deepinfra-api-key <key>
The environment variable approach also works:
export DEEPINFRA_API_KEY="<your-deepinfra-api-key>" # pragma: allowlist secret
Config snippet
{
env: { vars: { DEEPINFRA_API_KEY: "<your-deepinfra-api-key>" } }, // pragma: allowlist secret
agents: {
defaults: {
model: { primary: "deepinfra/deepseek-ai/DeepSeek-V4-Flash" },
},
},
}
Supported surfaces
Once DEEPINFRA_API_KEY has been set, chat, image generation, and video generation pull their model catalogs live from https://api.deepinfra.com/v1/openai/models?sort_by=openclaw&filter=with_meta. Live discovery widens the set of models you can pick; the default model for each surface remains the static value listed below. Until other surfaces are migrated to the same live catalog, they keep using static catalogs.
| Surface | Default model | OpenClaw config/tool |
|---|---|---|
| Chat / model provider | deepseek-ai/DeepSeek-V4-Flash (live catalog adds more chat models) | agents.defaults.model |
| Image generation/editing | black-forest-labs/FLUX-1-schnell (live catalog adds more image-gen models) | image_generate, agents.defaults.mediaModels.image |
| Media understanding | moonshotai/Kimi-K2.6 for images | inbound image understanding |
| Speech-to-text | openai/whisper-large-v3-turbo | inbound audio transcription |
| Text-to-speech | hexgrad/Kokoro-82M | tts.provider: "deepinfra" |
| Video generation | Pixverse/Pixverse-T2V (live catalog adds more video-gen models) | video_generate, agents.defaults.mediaModels.video |
| Memory embeddings | BAAI/bge-m3 | memory.search.provider: "deepinfra" |
Reranking, classification, object detection, and other native model types are also offered by DeepInfra. OpenClaw has no provider contract covering those categories at present, so the plugin leaves them unregistered.
Available models
After a key is configured, OpenClaw finds DeepInfra models on its own. To view the current list, run /models deepinfra or openclaw models list --provider deepinfra.
Every model listed on deepinfra.com can be used with the deepinfra/ prefix:
deepinfra/deepseek-ai/DeepSeek-V4-Flash
deepinfra/deepseek-ai/DeepSeek-V4-Pro
deepinfra/zai-org/GLM-5.2
deepinfra/moonshotai/Kimi-K2.6
deepinfra/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B
deepinfra/nvidia/NVIDIA-Nemotron-3-Super-120B-A12B
...and many more
Prompt caching
On the native https://api.deepinfra.com/v1/openai endpoint, OpenClaw attaches a stable prompt_cache_key to related requests so that automatic prefix cache reuse works better. If a request supplies its own cache key, that key wins over the session ID. Turning on cacheRetention: "none" removes this routing hint, though DeepInfra's automatic cache keeps working. Endpoints you configure yourself keep whatever behavior you gave them. OpenClaw never turns on paid cache retention by itself. See DeepInfra prompt caching.
Price estimates
For chat, discovery takes model membership, ordering, tags, and limits from DeepInfra's agent projection. Pricing is fetched separately from the anonymous native /models/list catalog. Cents per token are converted by the plugin into USD per million tokens, the advertised numeric discount is applied exactly once, and the native cached-input ratio is used. Both requests draw on the existing five-minute live-catalog cache and run concurrently only when chat discovery is configured. Chat prices are never requested by image or video discovery.
Schedules that are qualified by pricing prose, by a nonempty pricing table, or by a scheduled discount expiry stay unknown; OpenClaw will not guess context tiers or parse promotion dates. A declared generic cache-write rate is likewise left unsupported, since its numeric semantics are undocumented. Explicit 5-minute/1-hour retention and priority/flex rates are separate contracts, so standard estimates exclude them. Refer to DeepInfra's prompt caching and cache retention docs.
Where an individual price schedule is missing or unsupported, the required runtime zero-cost placeholder is used; that value signals unknown, not confirmed free billing. If a metadata or native pricing request fails, chat discovery is marked unavailable and the last successful catalog is kept for the same provider configuration and credentials. A successful response containing no models clears discovered chat models, even if pricing is unavailable. Bundled models that the response omits are not appended by live discovery. When no credentials exist, the bundled catalog stays available and nothing is fetched. Models and costs you configure explicitly stay authoritative; onboarding never pins provider prices.
The plugin's public buildDeepInfraProvider API keeps its advisory default: bundled choices are retained and unknown price estimates are used when discovery fails. OpenClaw's registered catalog hook explicitly selects discoveryMode: "strict", so failed or empty acquisitions reach the shared publication owner unchanged.
Hosted publication relies on the same native parser. Metadata is kept without cost for unsupported or absent schedules, declared zero prices are preserved, and the previous hosted catalog stays intact when the native feed fails validation. These updates follow the shared hosted catalog publication lifecycle.
Notes
- Model references use the form
deepinfra/<provider>/<model>(for instancedeepinfra/Qwen/Qwen3-Max). - Chat model used by default:
deepinfra/deepseek-ai/DeepSeek-V4-Flash - Base URL:
https://api.deepinfra.com/v1/openai - For video generation, the OpenAI-compatible async endpoint
https://api.deepinfra.com/v1/openai/videosis used (submit a job, then poll it). AnybaseUrlyou configure is respected. Onapi.deepinfra.com,openclaw doctor --fixautomatically migrates legacynativeBaseUrlor/v1/inferencevalues tobaseUrl; custom native endpoints are retired with a doctor notice, and you must set an OpenAI-compatiblebaseUrlby hand. IfbaseUrlstill points at the retired/v1/inferencesurface, video generation fails with an actionable error before any request is sent.