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
- Modify the
config.yaml - Start the proxy
- 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))