Problem
OpenCode uses /v1/responses endpoint by default, but many popular providers (Kimi, DeepSeek, Gemini via OpenAI-compatible mode) only support /v1/chat/completions, resulting in 404 errors.
Affected Providers
- Kimi (Moonshot): Returns 404 for
/v1/responses - the endpoint does not exist
- DeepSeek: Authentication fails due to endpoint mismatch
- Gemini (OpenAI-compatible): Similar issues with endpoint compatibility
Error Examples
Kimi
POST https://api.moonshot.cn/v1/responses → 404 Not Found
DeepSeek
Unauthorized: Authentication Fails (governor)
Proposed Solution
Add apiType configuration option to allow providers to specify which API endpoint to use.
Example Configuration
{
"provider": {
"kimi": {
"npm": "@ai-sdk/openai-compatible",
"apiType": "chat-completions",
"options": {
"baseURL": "https://api.moonshot.cn/v1"
}
}
}
}
Backward Compatibility
Default to apiType: "responses" to maintain existing behavior for OpenAI and other providers.
Workaround
Currently users have to use OpenAI-compatible SDK with custom configuration, but the model selection and provider detection don't work properly.
Related
This affects the growing ecosystem of OpenAI-compatible APIs in China and other regions where providers have not yet migrated to the responses API.
Environment
- OpenCode version: 1.2.27
- OS: Linux
- Providers tested: Kimi (Moonshot), DeepSeek, Gemini
Problem
OpenCode uses
/v1/responsesendpoint by default, but many popular providers (Kimi, DeepSeek, Gemini via OpenAI-compatible mode) only support/v1/chat/completions, resulting in 404 errors.Affected Providers
/v1/responses- the endpoint does not existError Examples
Kimi
DeepSeek
Proposed Solution
Add
apiTypeconfiguration option to allow providers to specify which API endpoint to use.Example Configuration
{ "provider": { "kimi": { "npm": "@ai-sdk/openai-compatible", "apiType": "chat-completions", "options": { "baseURL": "https://api.moonshot.cn/v1" } } } }Backward Compatibility
Default to
apiType: "responses"to maintain existing behavior for OpenAI and other providers.Workaround
Currently users have to use OpenAI-compatible SDK with custom configuration, but the model selection and provider detection don't work properly.
Related
This affects the growing ecosystem of OpenAI-compatible APIs in China and other regions where providers have not yet migrated to the responses API.
Environment