Skip to content
Nilay Kabariya

Entry No.088·AI·Updated ·6 min read

Responses.create() unexpected keyword argument: new names

max_tokens, messages, response_format, seed: their names in OpenAI's Responses API, tested. Plus the 'proxies' TypeError from httpx 0.28.

by Nilay#openai#python#node#anthropic#httpxAI

The error, verbatim

Jump to the fix ↓
TypeError: Responses.create() got an unexpected keyword argument 'max_tokens'
✓ Reproduced on Windows 11 Pro

Tested on

openai (Python)
3.37.0 (Responses); 1.40.0, 1.55.2, 1.55.3 (proxies)
anthropic (Python)
0.39.0, 0.40.0
httpx / httpx2
0.27.2, 0.28.1 / 2.16.0
API
POST /v1/responses, gpt-5.5 and gpt-4.1-mini
Python
3.14.5
OS
Windows 11 Pro
Contents
  1. The renames01
  2. Two checks that move with the rename02
  3. seed, n and stop have no replacement03
  4. frequency_penalty and presence_penalty depend on the model04
  5. Client.__init__() got an unexpected keyword argument 'proxies'05
  6. How this was tested06

You moved a call from client.chat.completions.create() to client.responses.create() and kept the old arguments. The Responses API renamed most of them, moved some into nested objects and dropped a few, and the Python SDK checks names before it sends anything. So the TypeError comes from Python, and no request goes out.

From JavaScript, or through extra_body in Python, the same names do reach the API, and it answers with its own 400. I tried twelve Chat Completions arguments both ways (if your error names proxies and comes from creating the client, skip to that section):

Argument Python openai 3.37.0 API error (400)
messages TypeError Unsupported parameter: 'messages'. In the Responses API, this parameter has moved to 'input'.
max_tokens TypeError Unknown parameter: 'max_tokens'.
max_completion_tokens TypeError moved to 'max_output_tokens'
response_format TypeError moved to 'text.format'
verbosity TypeError moved to 'text.verbosity'
reasoning_effort TypeError moved to 'reasoning.effort'
seed TypeError Unknown parameter: 'seed'.
n TypeError Unknown parameter: 'n'.
stop TypeError (Python 3.14 adds Did you mean ‘store’?) Unknown parameter: 'stop'. Did you mean 'store'?
logprobs TypeError Unknown parameter: 'logprobs'.
frequency_penalty, presence_penalty TypeError on gpt-5.5: is not supported with this model.

Note what’s missing: the API’s message for max_tokens doesn’t point you to the new name, while the one for max_completion_tokens does.

The renames

Chat Completions Responses API
messages=[...] input=[...] (same list of role/content dicts)
max_tokens=500 or max_completion_tokens=500 max_output_tokens=500
response_format={"type": "json_object"} text={"format": {"type": "json_object"}}
verbosity="low" text={"verbosity": "low"}
reasoning_effort="low" reasoning={"effort": "low"}
logprobs=True, top_logprobs=2 top_logprobs=2, include=["message.output_text.logprobs"]

A converted call:

response = client.responses.create(
    model="gpt-5.5",
    input=[{"role": "user", "content": "Hello"}],
    max_output_tokens=500,
)
print(response.output_text)

If text needs both a format and a verbosity, put both keys in the one dict. text={"format": {"type": "json_object"}, "verbosity": "low"} passed the checks.

Two checks that move with the rename

Both came back as 400s once the names were right:

  • max_output_tokens has a floor. max_output_tokens=5 returned Invalid 'max_output_tokens': integer below minimum value. Expected a value >= 16, but got 5 instead. The same max_tokens=5 on Chat Completions got past its checks.
  • JSON mode still wants the word “json”. text={"format": {"type": "json_object"}} with the input "hi" returned Response input messages must contain the word 'json' in some form to use 'text.format' of type 'json_object'.

For a JSON schema, the shape changed too. The schema sits directly in format, next to a name. Without the name: Missing required parameter: 'text.format.name'. With it, the schema itself was checked as strict, and two more 400s came back:

Invalid schema for response_format 'answer': In context=(), 'additionalProperties' is required to be supplied and to be false.
Invalid schema for response_format 'answer': In context=(), 'required' is required to be supplied and to be an array including every key in properties. Missing 'a'.
text={"format": {
    "type": "json_schema",
    "name": "answer",
    "schema": {
        "type": "object",
        "properties": {"a": {"type": "string"}},
        "required": ["a"],
        "additionalProperties": False,
    },
}}

seed, n and stop have no replacement

The Responses API has no seed, no n and no stop. All three failed the same way on gpt-4.1-mini, so it isn’t a model limit.

  • n: send the request several times, in parallel if you need speed.
  • stop: cut the text yourself after it arrives, or ask for the shape you need in the prompt or a JSON schema.
  • seed: there’s nothing to send. If you depended on repeatable output, keep that call on Chat Completions: there, seed on gpt-4.1-mini got past the checks.

frequency_penalty and presence_penalty depend on the model

These two aren’t in the Python SDK’s responses.create(), so Python raises the TypeError for every model. At the API, they’re a model question: gpt-5.5 rejected both with Unsupported parameter: 'frequency_penalty' is not supported with this model., while on gpt-4.1-mini the same request got past validation. temperature behaved like this too: 'temperature' is not supported with this model. on gpt-5.5.

On a model that still accepts them, send them through extra_body:

client.responses.create(model="gpt-4.1-mini", input="Hello", extra_body={"frequency_penalty": 0.5})

Client.__init__() got an unexpected keyword argument 'proxies'

TypeError: Client.__init__() got an unexpected keyword argument 'proxies'

This one has nothing to do with responses.create(). httpx 0.28 removed the proxies argument, and anything that still passes it to httpx.Client() fails before a single request goes out. Older Pythons print the shorter __init__() got an unexpected keyword argument 'proxies'. Since 3.10, Python names the class, so you see Client.__init__().

The traceback tells you who passed proxies:

Last lines of the traceback Who passed proxies
inside openai/_base_client.py or anthropic/_base_client.py, from OpenAI() / Anthropic() an old SDK, with your own code doing nothing wrong
your own file, calling httpx.Client(...) or httpx.post(...) your code

From OpenAI() or Anthropic()

A plain client = openai.OpenAI() was enough to raise it. Old SDK versions built their internal httpx.Client with proxies=, and pip happily installed the newest httpx next to them:

openai.OpenAI() with httpx 0.27.2 httpx 0.28.1
openai 1.40.0 not tested TypeError
openai 1.55.2 worked TypeError
openai 1.55.3 not tested worked
openai 3.37.0 not tested worked

anthropic.Anthropic() behaved the same way: 0.39.0 raised the TypeError with httpx 0.28.1, and 0.40.0 worked.

Upgrade the SDK:

pip install -U "openai>=1.55.3"
pip install -U "anthropic>=0.40.0"

If you can’t upgrade the SDK yet, hand it a client you built yourself. It then skips building its own, along with the bad argument:

import httpx, openai

client = openai.OpenAI(http_client=httpx.Client())

Pinning httpx<0.28 also made 1.55.2 work again. That’s the least good option: it holds back every other package that wants a newer httpx.

openai.OpenAI(proxies=...) was never an argument of the client itself. It failed on every version I tried, and 3.37.0 adds Did you mean ‘provider’?, which isn’t what you want either. The proxy goes on the HTTP client, as below.

From your own httpx code

Here, the argument is yours. httpx.Client(proxies=...) and httpx.post(url, proxies=...) both raised the TypeError on 0.28.1, and both worked on 0.27.2.

Use proxy, singular, for one proxy for everything:

client = httpx.Client(proxy="http://127.0.0.1:8080")

If you had a dict of different proxies per scheme, each one becomes a transport under mounts:

client = httpx.Client(mounts={
    "http://": httpx.HTTPTransport(proxy="http://127.0.0.1:8080"),
    "https://": httpx.HTTPTransport(proxy="http://127.0.0.1:8081"),
})

A proxy for the OpenAI client

Give the proxy to the HTTP client and the HTTP client to OpenAI. DefaultHttpxClient keeps the SDK’s own timeouts and connection limits:

client = openai.OpenAI(http_client=openai.DefaultHttpxClient(proxy="http://127.0.0.1:8080"))

That request reached my proxy on 1.40.0, 1.55.2, 1.55.3 and 3.37.0. DefaultHttpxClient(proxies=...) raised the same TypeError on all of them except 1.55.2 with httpx 0.27.2.

Current SDKs use httpx2, not httpx

openai 3.37.0 and anthropic 2.1.0 don’t depend on httpx anymore. Both require httpx2 (2.16.0 here), so pip install openai in a fresh venv doesn’t install httpx at all. Two things follow:

  • httpx2.Client(proxies=...) raised the same TypeError. proxy= and mounts= worked as above.
  • If you import httpx in your own code, install it yourself. Passing a plain httpx.Client(proxy=...) to openai.OpenAI(http_client=...) still worked on 3.37.0, with httpx 0.28.1 installed next to httpx2.

These proxies tests ran on Windows 11 Pro, Python 3.14.5, October 23, 2026. Each combination of SDK and httpx ran in its own venv. The script built the clients, then sent requests through a local HTTP server acting as the proxy, which recorded every request that reached it. No real API calls were made. That test script is public too.

How this was tested

Windows 11 Pro, Python 3.14.5, openai 3.37.0, October 23, 2026. Each argument was passed to client.responses.create() against a local server that recorded the request body. The same JSON bodies were then sent with curl to https://api.openai.com/v1/responses with a key that has no credits: the API checks parameters before credits, so wrong parameters came back as 400s and valid requests as credit_balance_exhausted. No response text was generated. The test script is public.

— N.K., end of entry No.088

Useful? Pass it on:Post on XFollow @EmotionalMatter

Related entries

  1. No.059

    OpenAI Oct 23 model shutdown: the 404, list, replacements

    gpt-3.5-turbo, gpt-4, o1, o3-mini and more stopped working on October 23, 2026. The real error, tested after the shutdown, and a check that misleads.

    > NotFoundError: 404 The model `gpt-3.5-turbo` has been deprecated, learn more here: https://platform.openai.com/docs/deprecations

    AI4 min
  2. No.087

    Claude SDK: unexpected keyword argument temperature, betas

    Messages.create() got an unexpected keyword argument after an anthropic upgrade, plus what SDK 2.0 (October 21) breaks next. Python and TypeScript, tested.

    > TypeError: Messages.create() got an unexpected keyword argument 'temperature'

    AI4 min
  3. No.060

    Claude "temperature is deprecated for this model" (400)

    Switching to Claude Sonnet 5.5, Haiku 5.5 or Opus 4.7 breaks code that sets temperature, even temperature: 0. Every case tested, in Node and Python.

    > BadRequestError: 400 {"type":"error","error":{"type":"invalid_request_error","message":"`temperature` is deprecated for this model."}}

    AI4 min
  4. No.043

    Fix: APIConnectionError "Connection error." (OpenAI, Anthropic)

    OpenAI's and Anthropic's SDKs both say only Connection error. Five real causes reproduced, from a local model that isn't running to antivirus HTTPS scanning.

    > APIConnectionError: Connection error.

    AI5 minWindows

Post card · Every Sunday

What broke this week.

One email on Sundays: the Node, TypeScript, Python and AI SDK releases that broke builds that week, each one reproduced, with a link to the fix that worked. Never shared, and you can leave any time.

— Nilay

or follow by RSSor on X

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text