Skip to content

400 Bad Request for every openrouter prompt for 0.2.22 #842

Closed

Description

@eaSyMaxSU

The following error appears for openrouter promts.

ERROR 2025-07-10T15:54:07 +0ms service=tui failed to send message: POST "http://127.0.0.1:56639/session/ses_80af4d182ffe4EJ3Nw2XR5s0yS/message": 400 Bad Request {"name":"ProviderInitError","data":{"providerID":"openrouter"}}
Image

And the opencode auth.
Image

Activity

  1. changed the title [-]400 Bad Request for every openrouter prompt[/-] [+]400 Bad Request for every openrouter prompt for 0.2.22[/+] on Jul 10, 2025
  2. Pranav-Official commented on Jul 10, 2025

    @Pranav-Official

    same issue here... any idea anyone?

  3. DenzelVH commented on Jul 10, 2025

    @DenzelVH

    Same issue
    Image

    The issue is gone when I disable my config.json file + removing ~/.cache/opencode folder

    Image

    My config.json

    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "openrouter": {
          "npm": "@openrouter/ai-sdk-provider",
          "name": "OpenRouter",
          "options": {},
          "models": {
            "mistralai/devstral-medium": {
              "name": "Mistral: Devstral Medium"
            },
            "mistralai/devstral-small": {
              "name": "Mistral: Devstral Small 1.1"
            },
            "inception/mercury": {
              "name": "Inception: Mercury"
            }
          }
        }
      }
    }
    
  4. eaSyMaxSU commented on Jul 10, 2025

    @eaSyMaxSU
    Author

    Still having this issue after removing config.json and clearing cache/opencode.

  5. damianpdr commented on Jul 10, 2025

    @damianpdr

    same issue on my side

  6. self-assigned this
    on Jul 10, 2025
  7. thdxr commented on Jul 10, 2025

    @thdxr
    Member

    @openrouter/ai-sdk-provider does not work with ai sdk v5 which we use. remove the npm field you don't need it. also we added devstral to models.dev so you can probably get rid of the whole config

  8. eaSyMaxSU commented on Jul 11, 2025

    @eaSyMaxSU
    Author

    Removing the config do not solve the issue for me.

  9. DenzelVH commented on Jul 11, 2025

    @DenzelVH

    @openrouter/ai-sdk-provider does not work with ai sdk v5 which we use. remove the npm field you don't need it. also we added devstral to models.dev so you can probably get rid of the whole config

    Is it only available via the Mistral provider?

    Image

    Edit: nvm, I use this setup for Devstral Openrouter and it works

    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "openrouter": {
          "name": "OpenRouter",
          "options": {},
          "models": {
            "mistralai/devstral-medium": {
              "name": "Devstral Medium",
              "attachment": false,
              "reasoning": false,
              "temperature": true,
              "tool_call": true,
              "release_date": "2025-07-10",
              "cost": { "input": 0.4, "output": 2 },
              "limit": { "context": 128000, "output": 128000 }
            },
            "mistralai/devstral-small": {
              "name": "Devstral Small",
              "attachment": false,
              "reasoning": false,
              "temperature": true,
              "tool_call": true,
              "release_date": "2025-05-07",
              "cost": { "input": 0.1, "output": 0.3 },
              "limit": { "context": 128000, "output": 128000 }
            }
          }
        }
      }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions