LiteLLM with Muapi

LiteLLM can call Muapi's OpenAI-compatible chat endpoint directly or expose it through a LiteLLM proxy.

Direct Python call

Install LiteLLM and choose a text model from https://api.muapi.ai/v1/models?type=text:

pip install litellm
export MUAPI_API_KEY="your-key"
import os
from litellm import completion

response = completion(
    model="openai/qwen-3-8-27b-obliterated",
    api_base="https://api.muapi.ai/v1",
    api_key=os.environ["MUAPI_API_KEY"],
    messages=[{"role": "user", "content": "Write a short project summary."}],
)
print(response.choices[0].message.content)

Replace the sample with an available text model ID.

LiteLLM proxy configuration

Create config.yaml:

model_list:
  - model_name: muapi-chat
    litellm_params:
      model: openai/qwen-3-8-27b-obliterated
      api_base: https://api.muapi.ai/v1
      api_key: os.environ/MUAPI_API_KEY

Then run the proxy using LiteLLM's documented command:

export MUAPI_API_KEY="your-key"
litellm --config config.yaml

Clients connect to the LiteLLM proxy; keep the Muapi key on the server and avoid committing it to the YAML file.

Notes

  • Muapi accepts POST /v1/chat/completions. Use https://api.muapi.ai/v1 as api_base.
  • Use model IDs from the Muapi text model list. Function calling is available only on models marked capabilities.tools: true.
  • This setup covers chat completions. Muapi's image-generation endpoint is a separate API; see OpenAI-Compatible Endpoint.

See LiteLLM's OpenAI-compatible provider docs for current configuration details.