Put the key in DOCSUMO_API_KEY instead of hardcoding it. Treat upload and extraction as two steps: upload first, then poll extracted_data with the returned document ID. Check the credit limit endpoint before a big batch run so you do not hit the monthly quota mid-job.

Context: Official package docs (PyPI docsumo client): documents that the client reads the API key from the DOCSUMO_API_KEY environment variable or the constructor's apikey argument, that upload_file takes a path plus a document type, that extracted_data takes a document_id in a separate step, and that user_detail_credit_limit shows remaining monthly quota.