# [Bug] `/v1/responses` endpoint forwards unsupported `user` parameter to upstream, causing 400 error

Open Beginner friendly
#1,264 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
api

Research direction

Start in internal/service/openai_gateway_service.go around line 1914, where the Responses API unsupportedFields list is defined. Reproduce the POST /v1/responses request with a user field and verify that the forwarded request no longer includes it and the upstream 400 error is resolved.

Written by the indexing model from the issue text.

Description

[Bug] /v1/responses endpoint forwards unsupported user parameter to upstream, causing 400 error

Description

When clients (e.g., LobeHub v2) send requests to the /v1/responses endpoint with a user parameter, Sub2API forwards this parameter to the upstream OpenAI API without filtering it out. The upstream API rejects the request with a 400 Bad Request error: Unsupported parameter: user.

This issue affects models like gpt-5.4, gpt-5.3-codex, etc., when accessed through the Responses API endpoint.

Steps to Reproduce

  1. Send a POST request to /v1/responses (or /responses) with a body that includes the user field:
{
  "model": "gpt-5.4",
  "stream": true,
  "input": [
    {"role": "user", "content": "hello"}
  ],
  "user": "user_123"
}
  1. Sub2API forwards the request to the upstream OpenAI API, including the user parameter.

  2. The upstream API returns: 400 Bad Request - Unsupported parameter: user

Error Log

2026-03-24T19:44:46.925+0800  WARN  handler/openai_gateway_handler.go:337  openai.forward_failed
{
  "component": "handler.openai_gateway.responses",
  "model": "gpt-5.4",
  "stream": true,
  "error": "upstream error: 400 message=Unsupported parameter: user"
}

Expected Behavior

The user parameter should be stripped from the request body before forwarding to the upstream API, similar to how other unsupported parameters (prompt_cache_retention, safety_identifier) are already handled.

Suggested Fix

In internal/service/openai_gateway_service.go, add "user" to the unsupportedFields list:

// Current code (line ~1914):
unsupportedFields := []string{"prompt_cache_retention", "safety_identifier"}

// Suggested fix:
unsupportedFields := []string{"prompt_cache_retention", "safety_identifier", "user"}

Environment

  • Sub2API version: 0.1.104 (commit: 4f7629a4, built: 2026-03-20)
  • Client: LobeHub v2.1.44
  • Upstream: OpenAI API (OAuth accounts)
  • Affected endpoint: POST /v1/responses and POST /responses
  • Affected models: All models accessed via Responses API (gpt-5.4, gpt-5.3-codex, etc.)

Additional Context

  • The /v1/chat/completions endpoint is NOT affected — only /v1/responses.
  • LobeHub v2 sends the user parameter for user tracking purposes. The upstream OpenAI Responses API does not support this parameter.
  • Similar issues have been fixed before: max_output_tokens was handled in a similar way (ref: #831, PR #1107).
Dominant language
Go
Stars
42.1k
Forks
9k
Avg merge
1d 14h
Merged PRs (30d)
343

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Wei-Shaw/sub2api

All issues in Wei-Shaw/sub2api

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.