Inference APIs
Integrations/Gateway / SDK

Use Inference APIs with LiteLLM

Use the openai/ prefix with api_base to route any LiteLLM call — SDK or proxy — to Inference APIs, including as a fallback provider.

Settings

SettingValue
Base URLhttps://api.inferenceapis.com/v1 (also /openai/v1)
API keyFrom API Keys; send as Authorization: Bearer …
Chat model idsopenai/gpt-oss-120b, deepseek-ai/DeepSeek-V4-Flash, zai-org/GLM-5.3-Flash, meta-llama/Llama-3.3-70B-Instruct-Turboall models
Audio model idsopenai/whisper-large-v3 (transcription), hexgrad/Kokoro-82M (speech)

Configuration

Python SDK
import os, litellm

resp = litellm.completion(
    model="openai/openai/gpt-oss-120b",        # openai/ prefix = OpenAI-compatible endpoint
    api_base="https://api.inferenceapis.com/v1",
    api_key=os.environ["INFERENCE_API_KEY"],
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
Proxy config.yaml with fallback
model_list:
  - model_name: chat
    litellm_params:
      model: groq/openai/gpt-oss-120b
      api_key: os.environ/GROQ_API_KEY
  - model_name: chat-fallback
    litellm_params:
      model: openai/openai/gpt-oss-120b
      api_base: https://api.inferenceapis.com/v1
      api_key: os.environ/INFERENCE_API_KEY

router_settings:
  fallbacks: [{ "chat": ["chat-fallback"] }]

Verify

Smoke test
litellm --model openai/openai/gpt-oss-120b --api_base https://api.inferenceapis.com/v1 --api_key $INFERENCE_API_KEY --test

Gotchas

  • The double prefix is intentional: the first openai/ tells LiteLLM the protocol, the rest is our model id.
  • Set drop_params: true if a caller sends parameters a model does not support.

If something fails

401 — key missing or wrong · 402 insufficient_balance — add credits on Billing · 404 model_not_found — check the id against the model list (aliases such as gpt-oss-120b work too) · 503 model_unavailable — the model is being enabled. Full details in the API docs.