Using Oxlo with OpenAI SDK for LLM
Описание и применение
Oxlo.ai позволяет использовать 45+ моделей LLM, vision и audio без изменения кода, заменяя только базовый URL и ключ API.
Задача
Inference providers often require rewriting client code or managing fragmented SDKs when switching backends.
Результат
By switching to Oxlo.ai, teams can access 45+ models across seven categories with zero code changes, preserving existing logic and reducing engineering effort.
Рабочий процесс
- 1. Sign up at Oxlo.ai and obtain an API key.
- 2. Install the official OpenAI SDK (pip install openai or npm install openai).
- 3. Set the environment variable OXLO_API_KEY with your key.
- 4. Instantiate the OpenAI client with base_url="https://api.oxlo.ai/v1" and the API key.
- 5. Call any supported model (e.g., llama-3.3-70b) using the same chat.completions API.
- 6. For streaming, set stream=True and iterate over chunks.
- 7. For function calling or tool use, define tools in the request and let the model invoke them.
- 8. For vision or multimodal inputs, include image URLs or base64 strings in the message content array.
- 9. Deploy the updated client in production without changing retry logic, token counting, or streaming parsers.
Доказательства
Oxlo.ai removes that friction. Because the platform is fully OpenAI SDK compatible, you can point your existing Python or Node.js client to Oxlo.ai and immediately access 45+ models across seven categories, from reasoning LLMs to vision and audio, without changing your application logic.
The platform exposes chat/completions, embeddings, images/generations, audio/transcriptions, and audio/speech endpoints that follow the OpenAI schema exactly.
- Дата записи: 2026-09-15T22:30:23.434Z