Setup
- In OpenCode, run
/connect, scroll to Other, and enter a provider id such asluv13. Then paste your luv13 key. - Create or edit
opencode.jsonin your project and add a provider with the same id:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"luv13": {
"npm": "@ai-sdk/openai-compatible",
"name": "luv13",
"options": {
"baseURL": "https://api.luv13.ai/v1"
},
"models": {
"luv13/glm-5.3-flash": {
"name": "GLM 5.3 Flash (luv13)"
}
}
}
}
}- Run
/modelsand pick the luv13 model.
Using an environment variable instead
OpenCode's config supports {env:NAME} values, so you can skip /connect and read the key from your environment:
"options": {
"baseURL": "https://api.luv13.ai/v1",
"apiKey": "{env:LUV13_API_KEY}"
}Notes
- The keys under
modelsmust match luv13's ids exactly. Get them fromhttps://api.luv13.ai/v1/models. See Model IDs. - OpenCode lets you set
limit.contextandlimit.outputper model. luv13's model list doesn't publish context lengths, so leave these out unless the operator gives you numbers. See Context Window. - OpenCode is an agent that relies on tool calling. See Tool Calling on luv13.
- If it doesn't work, run
opencode auth listto check the credential, and make sure the provider id in/connectmatches the one inopencode.json.
Check your settings first
curl https://api.luv13.ai/v1/chat/completions \
-H "Authorization: Bearer $LUV13_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "luv13/glm-5.3-flash", "messages": [{"role": "user", "content": "Hi"}]}'