#Title: Sarvam AI custom provider not working - assistant turn failed
1 messages · Page 1 of 1 (latest)
Yep — baseUrl: "https://api.sarvam.ai/v1" + api: "openai-completions" is the right shape for Sarvam’s /v1/chat/completions API.
The catch: a successful curl with a simple prompt does not prove it can handle a full OpenClaw agent turn. OpenClaw may send richer message content and tool schemas, and OpenAI-compatible providers often fail there with the generic “assistant turn failed before producing content”.
Try this config first:
{
env: {
SARVAM_API_KEY: "..."
},
agents: {
defaults: {
model: { primary: "sarvam/sarvam-30b" }
}
},
models: {
mode: "merge",
providers: {
sarvam: {
baseUrl: "https://api.sarvam.ai/v1",
apiKey: "${SARVAM_API_KEY}",
api: "openai-completions",
timeoutSeconds: 120,
models: [{
id: "sarvam-30b",
name: "Sarvam 30B",
reasoning: false,
input: ["text"],
contextWindow: 32768,
maxTokens: 4096,
compat: {
requiresStringContent: true,
supportsTools: false
}
}]
}
}
}
}
Then restart the gateway and test outside Telegram:
openclaw models status