Can users customize the relay API server and model?
Question
Why hasn't this important feature been developed yet? There are many casual users who need custom API interface services!
This issue might be a duplicate of existing issues. Please check:
- #5674: Custom OpenAI-compatible provider options not being passed to API calls
- #5564: Does it support compatibility with OpenAI
- #5210: Custom OpenAI-compatible provider returns no text content
- #5812: [BUG] Bedrock provider: config options.region ignored for model ID prefixing
- #971: Model options are not forwarded for openai-compatible providers unless provider.name option is given
Feel free to ignore if none of these address your specific case.
This issue might be a duplicate of existing issues. Please check:这个问题可能是现有问题的重复。请查看:
- Custom OpenAI-compatible provider options not being passed to API calls #5674: Custom OpenAI-compatible provider options not being passed to API calls Custom OpenAI-compatible provider options not being passed to API calls #5674 : 没有将兼容 OpenAI 的自定义提供者选项传递给 API 调用
- Does it support compatibility with OpenAI #5564: Does it support compatibility with OpenAI Does it support compatibility with OpenAI #5564 : 是否支持与 OpenAI 兼容
- Custom OpenAI-compatible provider returns no text content #5210: Custom OpenAI-compatible provider returns no text content Custom OpenAI-compatible provider returns no text content #5210 : 自定义兼容 OpenAI 的提供者返回无文本内容
- [BUG] Bedrock provider: config options.region ignored for model ID prefixing #5812: [BUG] Bedrock provider: config options.region ignored for model ID prefixing [BUG] Bedrock provider: config options.region ignored for model ID prefixing #5812 : [BUG] Bedrock 提供者:config options.region 在模型 ID 前缀时被忽略
- Model options are not forwarded for openai-compatible providers unless provider.name option is given #971: Model options are not forwarded for openai-compatible providers unless provider.name option is given Model options are not forwarded for openai-compatible providers unless provider.name option is given #971 : 对于 openai 兼容的提供者,除非提供者.name 选项被给出,否则模型选项不会被转发
Feel free to ignore if none of these address your specific case.如果以上都不适用于您的具体情况,请忽略。
I've checked, and the problem remains unresolved! I especially want to mention that I suggest adding this feature to the desktop version; I know many people are using the API relay service! Please add a provider compatible with OpenAI!!! The user script configuration is too cumbersome!
What r u referring to?
The key is to specify baseURL in options and models. You can always follow instruction on https://opencode.ai/docs/providers/#custom-provider and do this
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"myprovider": {
"npm": "@ai-sdk/openai-compatible",
"name": "My AI ProviderDisplay Name",
"options": {
"baseURL": "https://api.myprovider.com/v1"
},
"models": {
"my-model-name": {
"name": "My Model Display Name"
}
}
}
}
}
The key is to specify
baseURLinoptionsandmodels. You can always follow instruction on https://opencode.ai/docs/providers/#custom-provider and do this
Completely agree. You only need to change the baseURL for the appropriate provider - I am using this for Anthropic over Azure on daily basis. Works like a charm.