Skip to main content

Get API Key

LiteLLM Integration with OpenAI-Compatible Endpoints

LiteLLM provides seamless integration with OpenAI-compatible endpoints using the upstream official OpenAI Python API library. This integration requires an API key for all requests, either through the api_key parameter or the OPENAI_API_KEY environment variable.

Usage - Completion

import litellm
import os

response = litellm.completion(
    model="axon-base", # or axon-code
    api_key="sk-1234",
    api_base="https://api.matterai.so/v1",     # set API Base of your Custom OpenAI Endpoint
    messages=[
                {
                    "role": "user",
                    "content": "What is MatterAI Axon?",
                }
    ],
)
print(response)

Reference

For more information, see the official LiteLLM documentation.