{"record":{"id":"bb1ac3d4d156e9a3","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-call-id-but-recei","errorCode":null,"errorMessage":"Expected a non-empty value for `call_id` but received {call_id!r}","messagePattern":"Expected a non-empty value for `call_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/realtime/calls.py","lineNumber":265,"sourceCode":"              cache), since messages are dropped from the beginning of the context. However,\n              clients can also configure truncation to retain messages up to a fraction of the\n              maximum context size, which will reduce the need for future truncations and thus\n              improve the cache rate.\n\n              Truncation can be disabled entirely, which means the server will never truncate\n              but would instead return an error if the conversation exceeds the model's input\n              token limit.\n\n          extra_headers: Send extra headers\n\n          extra_query: Add additional query parameters to the request\n\n          extra_body: Add additional JSON properties to the request\n\n          timeout: Override the client-level default timeout for this request, in seconds\n        \"\"\"\n        if not call_id:\n            raise ValueError(f\"Expected a non-empty value for `call_id` but received {call_id!r}\")\n        extra_headers = {\"Accept\": \"*/*\", **(extra_headers or {})}\n        return self._post(\n            path_template(\"/realtime/calls/{call_id}/accept\", call_id=call_id),\n            body=maybe_transform(\n                {\n                    \"type\": type,\n                    \"audio\": audio,\n                    \"include\": include,\n                    \"instructions\": instructions,\n                    \"max_output_tokens\": max_output_tokens,\n                    \"model\": model,\n                    \"output_modalities\": output_modalities,\n                    \"parallel_tool_calls\": parallel_tool_calls,\n                    \"prompt\": prompt,\n                    \"reasoning\": reasoning,\n                    \"tool_choice\": tool_choice,\n                    \"tools\": tools,\n                    \"tracing\": tracing,","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/realtime/calls.py#L247-L283","documentation":"Raised by RealtimeCalls.sync accept() when the `call_id` argument is falsy (empty string or None). The SDK validates path parameters before making the HTTP request because an empty call_id would produce a malformed URL (/realtime/calls//accept). It is a client-side guard, not a server response.","triggerScenarios":"Calling client.realtime.calls.accept(call_id=\"\") or call_id=None (or a variable that was never populated, e.g. an empty field from a call.created event payload).","commonSituations":"Storing call_id from an event where the field was absent, typo'd variable, defaulting call_id to \"\" instead of omit, or passing a falsy sentinel before the call object was created.","solutions":["Ensure call_id comes from a valid source, e.g. the `call` object's id from a realtime event or client.realtime.calls.create()","Check for a non-empty value before calling accept(): if not call_id: raise/log","If call_id is Optional in your flow, guard the whole call behind `if call_id is not None`"],"exampleFix":"// before\nclient.realtime.calls.accept(call_id=call_id or \"\")\n# after\nif not call_id:\n    raise ValueError(\"call_id missing; was the call created?\")\nclient.realtime.calls.accept(call_id=call_id)","handlingStrategy":"validation","validationCode":"if not isinstance(call_id, str) or not call_id.strip():\n    raise ValueError(f\"invalid call_id: {call_id!r}\")\nclient.realtime.calls.accept(call_id=call_id)","typeGuard":"def is_valid_call_id(v: object) -> bool:\n    return isinstance(v, str) and bool(v.strip())","tryCatchPattern":"try:\n    client.realtime.calls.accept(call_id=call_id)\nexcept ValueError as e:\n    logger.error(\"bad call_id: %s\", e)","preventionTips":["Always source call_id from the call resource or call events","Never default call_id to an empty string","Log ids when calls are created"],"tags":["realtime","parameter-validation","sync"],"backgroundTag":"invalid-argument-value","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}