Use with frameworks
OptiQ Cloud speaks OpenAI's chat completions format, so any library with an OpenAI-compatible adapter can call it. Give it the base URL and a key; there is nothing of ours to install.
| Setting | Value |
|---|---|
| Base URL | https://cloud.mlx-optiq.com/api/v1 |
| Key | sk-optiq-cloud-… from the dashboard, here read from OPTIQ_CLOUD_API_KEY |
| Models | glm-5.3-flash, deepseek-v4.1-flash, minimax-m3.1-flash, glm-5.3 |
Prices and context windows are on the overview, and GET /models returns them without a key. Fields, streaming and errors are in the API reference.
LiteLLM
The openai/ prefix picks LiteLLM's OpenAI-compatible adapter, which strips the prefix and sends the rest as the model id.
from litellm import completion
import os
reply = completion(
model="openai/glm-5.3-flash",
api_base="https://cloud.mlx-optiq.com/api/v1",
api_key=os.environ["OPTIQ_CLOUD_API_KEY"],
messages=[{"role": "user", "content": "Hello"}],
reasoning_effort="low",
)For the LiteLLM proxy, add the models to its config:
model_list:
- model_name: glm-5.3-flash
litellm_params:
model: openai/glm-5.3-flash
api_base: https://cloud.mlx-optiq.com/api/v1
api_key: os.environ/OPTIQ_CLOUD_API_KEYLangChain
from langchain_openai import ChatOpenAI
import os
llm = ChatOpenAI(
model="deepseek-v4.1-flash",
base_url="https://cloud.mlx-optiq.com/api/v1",
api_key=os.environ["OPTIQ_CLOUD_API_KEY"],
)
print(llm.invoke("Hello").content)LlamaIndex
Use OpenAILike from llama-index-llms-openai-like, and tell it the model is a chat model that can call tools.
from llama_index.llms.openai_like import OpenAILike
import os
llm = OpenAILike(
model="glm-5.3-flash",
api_base="https://cloud.mlx-optiq.com/api/v1",
api_key=os.environ["OPTIQ_CLOUD_API_KEY"],
is_chat_model=True,
is_function_calling_model=True,
context_window=1048576,
)Vercel AI SDK
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";
const optiq = createOpenAICompatible({
name: "optiq-cloud",
baseURL: "https://cloud.mlx-optiq.com/api/v1",
apiKey: process.env.OPTIQ_CLOUD_API_KEY,
});
const { text } = await generateText({ model: optiq("glm-5.3-flash"), prompt: "Hello" });Reasoning
Every model thinks by default, and thinking is billed as output. Pass reasoning_effort as above to think less. GLM 5.3 Flash, GLM 5.3 and MiniMax M3.1 Flash cannot turn thinking off, so none is refused on them with a 400; DeepSeek V4.1 Flash takes it. The values each model accepts are under Reasoning.
Coding agents such as Claude Code, Codex and OpenCode are covered in Use with coding agents.