litellm - 💡(How to fix) Fix [Bug]: 'function' is a required property, expected an object - 'tools.7'

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…

Error Message

INFO: 100.64.0.40:37266 - "GET /llm/api/v1/health/readiness HTTP/1.1" 200 OK INFO: 100.64.0.40:37268 - "GET /llm/api/v1/health/liveliness HTTP/1.1" 200 OK 14:00:09 - LiteLLM Proxy:ERROR: common_request_processing.py:1601 - litellm.proxy.proxy_server._handle_llm_api_exception(): Exception occured - litellm.BadRequestError: OpenAIException - 'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368). Received Model Group=deepseek-v4-pro Available Model Group Fallbacks=None Traceback (most recent call last): File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 1113, in async_streaming headers, response = await self.make_openai_chat_completion_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/logging_utils.py", line 297, in async_wrapper result = await func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 461, in make_openai_chat_completion_request raise e File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 438, in make_openai_chat_completion_request await openai_aclient.chat.completions.with_raw_response.create( File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/_legacy_response.py", line 384, in wrapped return cast(LegacyAPIResponse[R], await func(*args, **kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/resources/chat/completions/completions.py", line 2700, in create return await self._post( ^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/_base_client.py", line 1884, in post return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/_base_client.py", line 1669, in request raise self._make_status_error_from_response(err.response) from None openai.BadRequestError: Error code: 400 - {'error': {'message': "'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368)", 'type': 'invalid_request_error', 'param': '', 'code': None}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/main.py", line 622, in acompletion response = await init_response ^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 1163, in async_streaming raise OpenAIError( litellm.llms.openai.common_utils.OpenAIError: Error code: 400 - {'error': {'message': "'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368)", 'type': 'invalid_request_error', 'param': '', 'code': None}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/proxy/response_api_endpoints/endpoints.py", line 198, in responses_api response = await processor.base_process_llm_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/proxy/common_request_processing.py", line 1068, in base_process_llm_request responses = await llm_responses ^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5160, in async_wrapper return await self._ageneric_api_call_with_fallbacks( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3810, in _ageneric_api_call_with_fallbacks raise e File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3797, in _ageneric_api_call_with_fallbacks response = await self.async_function_with_fallbacks(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5634, in async_function_with_fallbacks return await self.async_function_with_fallbacks_common_utils( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5591, in async_function_with_fallbacks_common_utils raise original_exception File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5625, in async_function_with_fallbacks response = await self.async_function_with_retries(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5780, in async_function_with_retries self.should_retry_this_error( File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5984, in should_retry_this_error raise error File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5731, in async_function_with_retries response = await self.make_call(original_function, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5899, in make_call response = await response ^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3939, in _ageneric_api_call_with_fallbacks_helper raise e File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3925, in _ageneric_api_call_with_fallbacks_helper response = await response # type: ignore ^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 2097, in wrapper_async raise e File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 1896, in wrapper_async result = await original_function(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/responses/main.py", line 580, in aresponses raise litellm.exception_type( File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/responses/main.py", line 558, in aresponses response = await init_response ^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/responses/litellm_completion_transformation/handler.py", line 118, in async_response_api_handler ] = await litellm.acompletion( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 2097, in wrapper_async raise e File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 1896, in wrapper_async result = await original_function(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/main.py", line 641, in acompletion raise exception_type( ^^^^^^^^^^^^^^^ File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2456, in exception_type raise e File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 478, in exception_type raise BadRequestError( litellm.exceptions.BadRequestError: litellm.BadRequestError: OpenAIException - 'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368). Received Model Group=deepseek-v4-pro Available Model Group Fallbacks=None INFO: 100.64.0.5:52054 - "POST /llm/api/v1/responses HTTP/1.1" 400 Bad Request INFO: 100.64.0.40:38640 - "GET /llm/api/v1/health/readiness HTTP/1.1" 200 OK

Code Example

{
  "auth_m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inh4eHh4eHh4eHh4eHh4eHgifSwiaWF0IjoxNzc3NDI2OTM5LCJpc3MiOiJodHRwczovL2F1dGgub3BlbmFpLmNvbSIsImp0aSI6IjQzMWM3ZTcyLTE2YWQtNGI1Ni05YzZhLTcwNDU4ZjBlMTU2YSIsIm5hbWUiOiJKb2huIEx5dSIsInJhdCI6MTc3NzQyNjg1NSwic2lkIjoiNmE1MWQ0MzEtZDUxOS00MDkxLTk4NDctMDA1M2ZkNGMzZjExIiwic3ViIjoiYXV0aDB8NjM4ZDRlNGJjMTA1NTA4ZmI2YTQ3YjI4In0.L40DDKgOwIaTJGfdqLxwWFQQ9bFGD6TsX5sbn3G8iFQ",
    "access_token": "abc",
    "refresh_token": "abc",
    "account_id": "aaaaaaa"
  },
  "last_refresh": "2026-04-29T01:42:20.285917039Z"
}

---

[model_providers.new_api]
    name = "DeepSeek"
    base_url = "http://xxx/llm/api/v1"
    env_key = "MY_API_KEY"
    wire_api = "responses"
    
    [profiles.deepseek]
    model = "deepseek-v4-pro"
    model_provider = "new_api"
    
    
    [profiles.deepseek-flash]
    model = "deepseek-v4-flash"
    model_provider = "new_api"

---

INFO:     100.64.0.40:37266 - "GET /llm/api/v1/health/readiness HTTP/1.1" 200 OK
INFO:     100.64.0.40:37268 - "GET /llm/api/v1/health/liveliness HTTP/1.1" 200 OK
14:00:09 - LiteLLM Proxy:ERROR: common_request_processing.py:1601 - litellm.proxy.proxy_server._handle_llm_api_exception(): Exception occured - litellm.BadRequestError: OpenAIException - 'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368). Received Model Group=deepseek-v4-pro
Available Model Group Fallbacks=None
Traceback (most recent call last):
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 1113, in async_streaming
    headers, response = await self.make_openai_chat_completion_request(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/logging_utils.py", line 297, in async_wrapper
    result = await func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 461, in make_openai_chat_completion_request
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 438, in make_openai_chat_completion_request
    await openai_aclient.chat.completions.with_raw_response.create(
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/_legacy_response.py", line 384, in wrapped
    return cast(LegacyAPIResponse[R], await func(*args, **kwargs))
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/resources/chat/completions/completions.py", line 2700, in create
    return await self._post(
           ^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/_base_client.py", line 1884, in post
    return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/_base_client.py", line 1669, in request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': "'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368)", 'type': 'invalid_request_error', 'param': '', 'code': None}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/main.py", line 622, in acompletion
    response = await init_response
               ^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 1163, in async_streaming
    raise OpenAIError(
litellm.llms.openai.common_utils.OpenAIError: Error code: 400 - {'error': {'message': "'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368)", 'type': 'invalid_request_error', 'param': '', 'code': None}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/proxy/response_api_endpoints/endpoints.py", line 198, in responses_api
    response = await processor.base_process_llm_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/proxy/common_request_processing.py", line 1068, in base_process_llm_request
    responses = await llm_responses
                ^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5160, in async_wrapper
    return await self._ageneric_api_call_with_fallbacks(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3810, in _ageneric_api_call_with_fallbacks
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3797, in _ageneric_api_call_with_fallbacks
    response = await self.async_function_with_fallbacks(**kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5634, in async_function_with_fallbacks
    return await self.async_function_with_fallbacks_common_utils(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5591, in async_function_with_fallbacks_common_utils
    raise original_exception
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5625, in async_function_with_fallbacks
    response = await self.async_function_with_retries(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5780, in async_function_with_retries
    self.should_retry_this_error(
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5984, in should_retry_this_error
    raise error
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5731, in async_function_with_retries
    response = await self.make_call(original_function, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5899, in make_call
    response = await response
               ^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3939, in _ageneric_api_call_with_fallbacks_helper
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3925, in _ageneric_api_call_with_fallbacks_helper
    response = await response  # type: ignore
               ^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 2097, in wrapper_async
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 1896, in wrapper_async
    result = await original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/responses/main.py", line 580, in aresponses
    raise litellm.exception_type(
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/responses/main.py", line 558, in aresponses
    response = await init_response
               ^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/responses/litellm_completion_transformation/handler.py", line 118, in async_response_api_handler
    ] = await litellm.acompletion(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 2097, in wrapper_async
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 1896, in wrapper_async
    result = await original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/main.py", line 641, in acompletion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2456, in exception_type
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 478, in exception_type
    raise BadRequestError(
litellm.exceptions.BadRequestError: litellm.BadRequestError: OpenAIException - 'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368). Received Model Group=deepseek-v4-pro
Available Model Group Fallbacks=None
INFO:     100.64.0.5:52054 - "POST /llm/api/v1/responses HTTP/1.1" 400 Bad Request
INFO:     100.64.0.40:38640 - "GET /llm/api/v1/health/readiness HTTP/1.1" 200 OK
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Can not use litellm with codex which is already signed in with openai account.

Steps to Reproduce

  1. install codex and sign in with ChatGPT plus subscription, then the .codex/auth.json will have "auth_mode": "chatgpt", or you can just use this dummy auth.json, which does not really matter
{
  "auth_mode": "chatgpt",
  "OPENAI_API_KEY": null,
  "tokens": {
    "id_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhbXIiOlsicHdkIiwib3RwIiwibWZhIiwidXJuOm9wZW5haTphbXI6b3RwX2VtYWlsIl0sImF0X2hhc2giOiJ2QWJNay0zM1ZCdTgtak1felp1S093IiwiYXVkIjpbImFwcF9FTW9hbUVFWjczZjBDa1hhWHA3aHJhbm4iXSwiYXV0aF9wcm92aWRlciI6InBhc3N3b3JkIiwiYXV0aF90aW1lIjoxNzc3NDI2OTM3LCJlbWFpbCI6Inh4eHh4eHh4eHh4eHh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9bFGD6TsX5sbn3G8iFQ",
    "access_token": "abc",
    "refresh_token": "abc",
    "account_id": "aaaaaaa"
  },
  "last_refresh": "2026-04-29T01:42:20.285917039Z"
}
  1. add litellm provider and profile in .codex/config.toml, it should looks like
    [model_providers.new_api]
    name = "DeepSeek"
    base_url = "http://xxx/llm/api/v1"
    env_key = "MY_API_KEY"
    wire_api = "responses"
    
    [profiles.deepseek]
    model = "deepseek-v4-pro"
    model_provider = "new_api"
    
    
    [profiles.deepseek-flash]
    model = "deepseek-v4-flash"
    model_provider = "new_api"
  2. open codex and chat any thing, the error occurs.

Relevant log output

INFO:     100.64.0.40:37266 - "GET /llm/api/v1/health/readiness HTTP/1.1" 200 OK
INFO:     100.64.0.40:37268 - "GET /llm/api/v1/health/liveliness HTTP/1.1" 200 OK
14:00:09 - LiteLLM Proxy:ERROR: common_request_processing.py:1601 - litellm.proxy.proxy_server._handle_llm_api_exception(): Exception occured - litellm.BadRequestError: OpenAIException - 'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368). Received Model Group=deepseek-v4-pro
Available Model Group Fallbacks=None
Traceback (most recent call last):
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 1113, in async_streaming
    headers, response = await self.make_openai_chat_completion_request(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/logging_utils.py", line 297, in async_wrapper
    result = await func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 461, in make_openai_chat_completion_request
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 438, in make_openai_chat_completion_request
    await openai_aclient.chat.completions.with_raw_response.create(
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/_legacy_response.py", line 384, in wrapped
    return cast(LegacyAPIResponse[R], await func(*args, **kwargs))
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/resources/chat/completions/completions.py", line 2700, in create
    return await self._post(
           ^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/_base_client.py", line 1884, in post
    return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/openai/_base_client.py", line 1669, in request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': "'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368)", 'type': 'invalid_request_error', 'param': '', 'code': None}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/main.py", line 622, in acompletion
    response = await init_response
               ^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 1163, in async_streaming
    raise OpenAIError(
litellm.llms.openai.common_utils.OpenAIError: Error code: 400 - {'error': {'message': "'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368)", 'type': 'invalid_request_error', 'param': '', 'code': None}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/proxy/response_api_endpoints/endpoints.py", line 198, in responses_api
    response = await processor.base_process_llm_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/proxy/common_request_processing.py", line 1068, in base_process_llm_request
    responses = await llm_responses
                ^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5160, in async_wrapper
    return await self._ageneric_api_call_with_fallbacks(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3810, in _ageneric_api_call_with_fallbacks
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3797, in _ageneric_api_call_with_fallbacks
    response = await self.async_function_with_fallbacks(**kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5634, in async_function_with_fallbacks
    return await self.async_function_with_fallbacks_common_utils(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5591, in async_function_with_fallbacks_common_utils
    raise original_exception
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5625, in async_function_with_fallbacks
    response = await self.async_function_with_retries(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5780, in async_function_with_retries
    self.should_retry_this_error(
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5984, in should_retry_this_error
    raise error
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5731, in async_function_with_retries
    response = await self.make_call(original_function, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 5899, in make_call
    response = await response
               ^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3939, in _ageneric_api_call_with_fallbacks_helper
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/router.py", line 3925, in _ageneric_api_call_with_fallbacks_helper
    response = await response  # type: ignore
               ^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 2097, in wrapper_async
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 1896, in wrapper_async
    result = await original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/responses/main.py", line 580, in aresponses
    raise litellm.exception_type(
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/responses/main.py", line 558, in aresponses
    response = await init_response
               ^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/responses/litellm_completion_transformation/handler.py", line 118, in async_response_api_handler
    ] = await litellm.acompletion(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 2097, in wrapper_async
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/utils.py", line 1896, in wrapper_async
    result = await original_function(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/main.py", line 641, in acompletion
    raise exception_type(
          ^^^^^^^^^^^^^^^
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2456, in exception_type
    raise e
  File "/root/.local/share/uv/tools/litellm/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 478, in exception_type
    raise BadRequestError(
litellm.exceptions.BadRequestError: litellm.BadRequestError: OpenAIException - 'function' is a required property, expected an object - 'tools.7' (request id: 2026050814000888175137913018368). Received Model Group=deepseek-v4-pro
Available Model Group Fallbacks=None
INFO:     100.64.0.5:52054 - "POST /llm/api/v1/responses HTTP/1.1" 400 Bad Request
INFO:     100.64.0.40:38640 - "GET /llm/api/v1/health/readiness HTTP/1.1" 200 OK

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.83.14

Twitter / LinkedIn details

No response

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

litellm - 💡(How to fix) Fix [Bug]: 'function' is a required property, expected an object - 'tools.7'