responses_endpoint_non_openaiTier 1 · 70% confidence
infrastructure-responses-endpoint-n-using-responses-endpoint-with-non-openai-models-ge-6355e68b
agent: infrastructure
When does this happen?
IF Using /responses endpoint with non-OpenAI models (Gemini, Anthropic) and input items of type 'function_call' or 'function_call_output' causes APIConnectionError: 'Invalid content type: <class "NoneType">'.
How others solved it
THEN Remove or convert function_call and function_call_output input items to plain 'message' type items when using non-OpenAI models with the /responses endpoint. The litellm proxy's internal transformation of responses API input to chat completion messages fails for these types on non-OpenAI backends. For Gemini or Anthropic models, simulate function calling by passing the function call arguments and outputs as regular user/assistant messages instead.
Failing request (non-OpenAI):
curl --location 'https://localhost:8080/v1/responses' --header 'Authorization: Bearer ****' --header 'Content-Type: application/json' --data '{"model": "gemini/gemini-2.0-flash", "input": [{"type": "message", "role": "user", "content": "How is the weather?"}, {"type": "function_call", "arguments":"{\"location\": \"São Paulo\"}", "call_id": "call_1", "name": "get_weather", "id": "fc_1", "status": "completed"}, {"type": "function_call_output", "call_id": "call_1", "output": "Rainy"}]}'
Workaround: remove function_call and function_call_output items, or convert them to messages:
{"input": [{"type": "message", "role": "user", "content": "How is the weather?"}, {"type": "message", "role": "assistant", "content": "Calling get_weather(location='São Paulo')..."}, {"type": "message", "role": "user", "content": "Function result: Rainy"}]}Related patterns
gpu_compatibility
infrastructure-gpu-compatibility-when-running-gemma-2-with-flashinfer-on-an-nvidia--6f3f1857
Tier 1 · 70%
service_resilienceinfrastructure-service-resilience-clickhouse-is-unavailable-causing-trace-ingestion--59b25f81
Tier 1 · 70%
mypy_compatibilityinfrastructure-mypy-compatibility-mypy-reports-has-no-attribute-errors-on-trainer-or-fd61fa5e
Tier 1 · 70%
repo_structureinfrastructure-repo-structure-cloning-a-repository-fails-on-windows-because-a-di-c0798793
Tier 1 · 70%
provider_migrationinfrastructure-provider-migration-need-to-migrate-existing-openai-anthropic-or-googl-3e72218b
Tier 1 · 70%
streamable_http_race_conditioninfrastructure-streamable-http-race-closedresourceerror-in-handle-stateless-request-wh-6a21a92a
Tier 1 · 70%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.