Skip to content

GPT-5 Unsupported parameter reasoning.effort #1859

Closed

Description

@Salmin

I can't use GPT-5
Cleaning .cache/opencode doesn't help
AI_APICallError: Unsupported parameter: 'reasoning.effort' is not supported with this model.

opencode v0.4.26
API provider: OpenAI

Activity

  1. Askath commented on Aug 12, 2025

    @Askath

    Same issue for me, but only when using "opencode run"

  2. thdxr commented on Aug 12, 2025

    @thdxr
    Member

    this working for me - what is the version here cat ~/.cache/opencode/node_modules/@ai-sdk/openai/package.json

  3. Salmin commented on Aug 12, 2025

    @Salmin
    Author

    what is the version

    cat ~/.cache/opencode/node_modules/@ai-sdk/openai/package.json

    {
      "name": "@ai-sdk/openai",
      "version": "2.0.10",
      "license": "Apache-2.0",
      "sideEffects": false,
      "main": "./dist/index.js",
      "module": "./dist/index.mjs",
      "types": "./dist/index.d.ts",
      "files": [
        "dist/**/*",
        "CHANGELOG.md",
        "internal.d.ts"
      ],
      "exports": {
        "./package.json": "./package.json",
        ".": {
          "types": "./dist/index.d.ts",
          "import": "./dist/index.mjs",
          "require": "./dist/index.js"
        },
        "./internal": {
          "types": "./dist/internal/index.d.ts",
          "import": "./dist/internal/index.mjs",
          "module": "./dist/internal/index.mjs",
          "require": "./dist/internal/index.js"
        }
      },
      "dependencies": {
        "@ai-sdk/provider": "2.0.0",
        "@ai-sdk/provider-utils": "3.0.1"
      },
      "devDependencies": {
        "@types/node": "20.17.24",
        "tsup": "^8",
        "typescript": "5.8.3",
        "zod": "3.25.76",
        "@vercel/ai-tsconfig": "0.0.0"
      },
      "peerDependencies": {
        "zod": "^3.25.76 || ^4"
      },
      "engines": {
        "node": ">=18"
      },
      "publishConfig": {
        "access": "public"
      },
      "homepage": "https://ai-sdk.dev/docs",
      "repository": {
        "type": "git",
        "url": "git+https://github.com/vercel/ai.git"
      },
      "bugs": {
        "url": "https://github.com/vercel/ai/issues"
      },
      "keywords": [
        "ai"
      ],
      "scripts": {
        "build": "pnpm clean && tsup --tsconfig tsconfig.build.json",
        "build:watch": "pnpm clean && tsup --watch",
        "clean": "rm -rf dist *.tsbuildinfo",
        "lint": "eslint \"./**/*.ts*\"",
        "type-check": "tsc --build",
        "prettier-check": "prettier --check \"./**/*.ts*\"",
        "test": "pnpm test:node && pnpm test:edge",
        "test:update": "pnpm test:node -u",
        "test:watch": "vitest --config vitest.node.config.js",
        "test:edge": "vitest --config vitest.edge.config.js --run",
        "test:node": "vitest --config vitest.node.config.js --run"
      }
    }
    
  4. self-assigned this
    on Aug 12, 2025
  5. thdxr commented on Aug 12, 2025

    @thdxr
    Member

    do you have any additional config?

  6. Salmin commented on Aug 12, 2025

    @Salmin
    Author

    do you have any additional config?

    No, fresh installation.

  7. vitorfdl commented on Aug 13, 2025

    @vitorfdl

    Pick the gpt-5 option instead of gpt-5-latest. It worked for me

  8. rekram1-node commented on Aug 13, 2025

    @rekram1-node
    Contributor

    made PR, should fix

  9. f5epcim commented on Aug 13, 2025

    @f5epcim

    on 0.4.37, and private openai azure endpoint:

    • I see error with 'reasoningEffort'. Did you mean 'reasoning_effort'
    • I see "text_verbosity":"low" being sent 2x ( I do have it this way 'text_verbosity' specified in subagent ), it's not unified on requestBodyValues.

    Partial log:

    ERROR 2025-08-13T05:51:31 +5643ms service=session session=ses_75e04927cffennnv5Mz3Erx5Jf error={"error":{"name":"AI_APICallError","url":"......
    ....
    "requestBodyValues":{"model":"gpt-5","max_tokens":32000,"reasoningEffort":"minimal","textVerbosity":"low","name":"myTravelAgent","reasoning_effort":"minimal","text_verbosity":"low","messages":[{"role":"system","content":"You are an AI .......
    ...
    ,"responseBody":"{\"detail\":\"litellm.BadRequestError: AzureException BadRequestError - Unknown parameter: 'reasoningEffort'. Did you mean 'reasoning_effort'?. Received Model Group=gpt-5\\nAvailable Model Group Fallbacks=None\"}","isRetryable":false}
    INFO  2025-08-13T05:51:31 +1ms service=bus type=session.error publishing
    ERROR 2025-08-13T05:51:31 +3ms service=tui message=AI_APICallError: Bad Request name=UnknownError Server error
    INFO  2025-08-13T05:51:31 +0ms service=bus type=storage.write publishing
    INFO  2025-08-13T05:51:31 +0ms service=bus type=message.updated publishing
    
  10. Salmin commented on Aug 13, 2025

    @Salmin
    Author

    made PR, should fix

    v0.0.41 still AI_APICallError: Unsupported parameter: 'reasoning.effort' is not supported with this model.

  11. f5epcim commented on Aug 22, 2025

    @f5epcim

    on private azure instance, using opencode v0.5.13 I still have:

    Image
      "provider": {
        "XXXX": {
          "npm": "@ai-sdk/openai-compatible",     // tested with this or even without
          "name": "YYYY",
          "options": {
            "baseURL": "https://ai.yyyy.com/openai/",
            "apiKey": "{env:OPENAI_API_KEY}"
          },
          "models": {
            "gpt-5": { 
              "name": "gpt-5"
            },
    
    opencode run "hi" --model "XXXX/gpt-5"
    Error: AI_APICallError: litellm.BadRequestError: AzureException BadRequestError - Unknown parameter: 'reasoningEffort'. Did you mean 'reasoning_effort'?. Received Model Group=gpt-5
    Available Model Group Fallbacks=None

    when provider XXXX is replaced with "openai" and npm is commented then it works without problems. After all looks like new users wont have a problem, I went to this as I have had previous 4.1 configuration in place.

  12. epcim commented on Aug 22, 2025

    @epcim

    on private azure instance, using opencode v0.5.13 I still have:

    Image ``` "provider": { "XXXX": { "npm": "@ai-sdk/openai-compatible", // tested with this or even without "name": "YYYY", "options": { "baseURL": "https://ai.yyyy.com/openai/", "apiKey": "{env:OPENAI_API_KEY}" }, "models": { "gpt-5": { "name": "gpt-5" }, ```

    opencode run "hi" --model "XXXX/gpt-5"
    Error: AI_APICallError: litellm.BadRequestError: AzureException BadRequestError - Unknown parameter: 'reasoningEffort'. Did you mean 'reasoning_effort'?. Received Model Group=gpt-5
    Available Model Group Fallbacks=None

    when provider XXXX is replaced with "openai" and npm is commented then it works without problems. After all looks like new users wont have a problem, I went to this as I have had previous 4.1 configuration in place.

    But then I really have to call it opencode run "hi" --model "openai/gpt-5" with opencode run "hi" --model "YYYY/gpt-5" it will again fail on

    ERROR 2025-08-22T11:23:10 +0ms service=tui message=AI_APICallError: litellm.BadRequestError: AzureException BadRequestError - Unknown parameter: 'reasoningEffort'. Did you mean 'reasoning_effort'?. Received Model Group=gpt-5
    

    Which is a regression of previous error. Related to provider not having in name "openai".

  13. ncecere commented on Aug 24, 2025

    @ncecere

    Doing this also works

      "provider": {
        "CUSTOM_NAME": {
          "npm": "@ai-sdk/openai",     // tested with this or even without
          "name": "YYYY",
          "options": {
            "baseURL": "https://ai.yyyy.com/openai/",
            "apiKey": "{env:OPENAI_API_KEY}"
          },
          "models": {
            "gpt-5": { 
              "name": "gpt-5"
            },
    

    I'm talking to an OpenAI compatible API (LiteLLM) and gpt-5 and gpt-5-mini work with out an issue.

    I hope this helps, lets me keep things organized too.

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