Implement a custom retry mechanism for a flaky API call.
For deterministic testing, responses contains the results of sequential API attempts. Each item is a dictionary with ok and either value or error. Return the first successful result, or the final error after max_retries retries.
Function signature: def retry_api_call(responses, max_retries):
ok booleanvalue; a failed response contains errordef retry_api_call(responses, max_retries):