openclaw - 💡(How to fix) Fix [Bug]: stepfun/step-3.5-flash returns 401 when used directly (not via openrouter) [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59186Fetched 2026-04-08 02:27:44
View on GitHub
Comments
1
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1

When using stepfun/step-3.5-flash model directly (not via openrouter), OpenClaw returns 401 Incorrect API key provided, even though the API key is correct (verified via curl).

Root Cause

When using stepfun/step-3.5-flash model directly (not via openrouter), OpenClaw returns 401 Incorrect API key provided, even though the API key is correct (verified via curl).

Code Example

"stepfun": {
  "api": "openai-completions",
  "apiKey": "STEP_API_KEY",
  "baseUrl": "https://api.stepfun.com/step_plan/v1",
  "models": [
    {
      "contextWindow": 256000,
      "id": "step-3.5-flash",
      "maxTokens": 8192,
      "name": "step-3.5-flash",
      "reasoning": true
    }
  ]
}
RAW_BUFFERClick to expand / collapse

Bug type

Regression / API authentication issue

Summary

When using stepfun/step-3.5-flash model directly (not via openrouter), OpenClaw returns 401 Incorrect API key provided, even though the API key is correct (verified via curl).

Environment

  • OpenClaw version: 2026.3.31
  • Platform: Linux
  • Provider: stepfun (direct, not via openrouter)

Configuration

"stepfun": {
  "api": "openai-completions",
  "apiKey": "STEP_API_KEY",
  "baseUrl": "https://api.stepfun.com/step_plan/v1",
  "models": [
    {
      "contextWindow": 256000,
      "id": "step-3.5-flash",
      "maxTokens": 8192,
      "name": "step-3.5-flash",
      "reasoning": true
    }
  ]
}

Steps to reproduce

  1. Configure stepfun provider with correct API key in environment variable STEP_API_KEY
  2. Set primary model to stepfun/step-3.5-flash
  3. Attempt to use the model (e.g., via /model switch or direct API call)

Expected behavior

Model should respond normally using the stepfun API.

Actual behavior

Returns: 401 Incorrect API key provided

Verification

  • curl test with same API key and endpoint works correctly
  • API key is correctly set in environment
  • stepfun API responds correctly when called directly

Related issues

  • #34830 - similar issue with stepfun via openrouter
  • #43980 - Fix OpenRouter auth header (PR)

extent analysis

TL;DR

Verify that the STEP_API_KEY environment variable is correctly passed to the OpenClaw application and check the API key formatting for any potential issues.

Guidance

  • Review the OpenClaw configuration to ensure it is correctly referencing the STEP_API_KEY environment variable.
  • Check the stepfun API documentation for any specific requirements or formatting guidelines for the API key.
  • Compare the API key used in the curl test with the one used in the OpenClaw configuration to identify any potential discrepancies.
  • Investigate if there are any differences in how the API key is handled when using the stepfun provider directly versus via openrouter.

Example

No code example is provided as the issue does not require a code change, but rather a configuration or environment variable verification.

Notes

The issue may be related to how the API key is being passed or formatted in the OpenClaw application, or it could be a specific issue with the stepfun provider. Further investigation is needed to determine the root cause.

Recommendation

Apply workaround: Verify the API key and environment variable configuration to ensure correct passing and formatting of the API key, as the curl test indicates that the API key is correct when used directly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Model should respond normally using the stepfun API.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING