Skip to content
SDKs & Integrations

LiteLLM

Integration with LiteLLM's OpenAI-Compatible Endpoints with SIRAYA Model Router

Account & API Keys Setup

The first step to start using SIRAYA Model Router is to create an account and get your API key.

Usage - completion

import litellm

response = litellm.completion(
    model="openai/claude-sonnet-4.5",               # add `openai/` prefix to model so litellm knows to route to OpenAI
    api_key="<API_KEY>",                  # api key to your openai compatible endpoint
    api_base="https://llm.siraya.ai/v1",     # set API Base of your Custom OpenAI Endpoint
    messages=[
        {
            "role": "user",
            "content": "Hey, how's it going?",
        }
    ],
)
print(response.model_dump_json(indent=2))

Usage - embedding

import litellm

response = litellm.embedding(
    model="openai/gemini-embedding-2",   # add `openai/` prefix to model so litellm knows to route to OpenAI
    api_key="<API_KEY>",                  # api key to your openai compatible endpoint
    api_base="https://llm.siraya.ai/v1", # set API Base of your Custom OpenAI Endpoint
    input=["good morning from litellm"]
)
print(response.model_dump_json(indent=2))

Usage with LiteLLM Proxy Server

  1. Modify the config.yaml
    model_list:
      - model_name: my-model
        litellm_params:
          model: openai/claude-sonnet-4.5          # add openai/ prefix to route as OpenAI provider
          api_base: https://llm.siraya.ai/v1      # SIRAYA Model Router base URL
          api_key: <API_KEY>                       # your SIRAYA API key
    
  2. Start the proxy
    litellm --config ./config.yaml
    
  3. Send Request to LiteLLM Proxy Server
    import openai
    
    client = openai.OpenAI(
        api_key="sk-1234",             # pass litellm proxy key, if you're using virtual keys
        base_url="http://0.0.0.0:4000" # litellm-proxy-base url
    )
    
    response = client.chat.completions.create(
        model="my-model",              # the model_name from config.yaml
        messages = [
            {
                "role": "user",
                "content": "what llm are you"
            }
        ],
    )
    
    print(response.model_dump_json(indent=2))