opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Openrouter Error

Open shirokun20 opened this issue 1 year ago • 12 comments

🐛 AI_APICallError: No endpoints found that support tool use

Environment

  • OS: macOS 15.5
  • OpenCode Version: 0.3.8
  • Provider: OpenRouter
  • Model: tngtech/deepseek-r1t2-chimera:free, moonshotai/kimi-k2:free
  • Timestamp: 2025-07-15 07:21:46

🔍 Description

When initiating a session using OpenRouter as the provider, OpenCode returned the following error:

AI_APICallError: No endpoints found that support tool use. To learn more about provider routing, visit: https://openrouter.ai/docs/provider-routing

This happened after the session was created and message parts were successfully updated. The error seems related to the selected model not supporting the tool use feature.


🪵 Relevant Logs

ERROR 2025-07-15T07:21:46 +1ms service=session session=ses_7f30c2bd6ffe3KD1tNALk58y9a error=AI_APICallError: No endpoints found that support tool use. To learn more about provider routing, visit: https://openrouter.ai/docs/provider-routing

ERROR 2025-07-15T07:19:27 +0ms service=session session=ses_7f30c2bd6ffe3KD1tNALk58y9a error=AI_APICallError: Provider returned error

ERROR 2025-07-15T07:19:27 +0ms service=tui message=AI_APICallError: Provider returned error name=UnknownError Server error

shirokun20 avatar Jul 15 '25 07:07 shirokun20

It seems like deepseek-r1t2-chimera:free is misconfigured on models.dev, the model is setup with tool_usage support while https://openrouter.ai/api/frontend/models return that the model doesn't support tool. You can workaround it for now by updating your opencode config with:

  "provider": {
    "openrouter": {
      "models": {
        "tngtech/deepseek-r1t2-chimera:free": {
          "name": "DeepSeek R1T2 Chimera (free)",
          "tool_call": false,
          "reasoning": true
        }
      }
    }
  }

AurelienTollard avatar Jul 15 '25 07:07 AurelienTollard

still not work

shirokun20 avatar Jul 15 '25 11:07 shirokun20

{ "id": 15543382862, "generation_id": "", "provider_name": "Chutes", "model": "tngtech/deepseek-r1t2-chimera:free", "app_id": 2312835, "external_user": null, "streamed": true, "cancelled": false, "generation_time": 1761, "latency": 1524, "moderation_latency": null, "created_at": "2025-07-15T11:13:48.346898+00:00", "tokens_prompt": 2612, "tokens_completion": 101, "native_tokens_prompt": 2656, "native_tokens_completion": 104, "native_tokens_reasoning": 106, "native_tokens_cached": 0, "num_media_prompt": null, "num_media_completion": null, "num_search_results": null, "origin": "https://opencode.ai/", "usage": 0, "finish_reason": "stop", "usage_cache": null, "usage_data": null, "usage_web": null, "usage_file": 0, "byok_usage_inference": null, "provider_responses": [ { "id": "1a0ec4e9626f4c74a38a088d71961a80", "endpoint_id": "62aa67ef-4310-4921-9da1-e86543114d22", "provider_name": "Chutes", "status": 200, "latency": 1513, "is_byok": false } ], "provider_api_key_id": null, "is_byok": false, "native_finish_reason": "stop", "app": { "id": 2312835, "created_at": "2025-06-17T19:38:45.470675+00:00", "description": null, "title": "OpenCode Model Validation", "main_url": null, "origin_url": "https://opencode.ai/", "source_code_url": null } }

shirokun20 avatar Jul 15 '25 11:07 shirokun20

same here for Kimi K2 free

jackyko1991 avatar Jul 15 '25 13:07 jackyko1991

I've also noticied this for most models on OpenRouter. I'm making sure to crosscheck models.dev to see if the model supports tooling

frank-besson avatar Jul 15 '25 17:07 frank-besson

just paid models work

davghz avatar Jul 16 '25 15:07 davghz

closing as there's nothing we can do about this - feel free to continue convo

thdxr avatar Jul 16 '25 18:07 thdxr

Hey everyone, for anyone coming across these issues, I've opened 2 pull requests on the models.dev repo to address the problems with these free OpenRouter models.:

  • Fix for tngtech/deepseek-r1t2-chimera:free: https://github.com/sst/models.dev/pull/80
  • Added support for Kimi-K2:free: https://github.com/sst/models.dev/pull/81**

Hope this helps!

nick-galluzzo avatar Jul 26 '25 09:07 nick-galluzzo

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

rekram1-node avatar Dec 28 '25 01:12 rekram1-node

I am experiencing this issue as well, is there a reliable walk-around?

samueltuyizere avatar Jan 25 '26 14:01 samueltuyizere

Seconded - appears to have re emerged.

dammitpogi avatar Feb 12 '26 15:02 dammitpogi

Is there any workaround for this?

io-PEAK avatar Apr 05 '26 11:04 io-PEAK