When create batch job, we got"Error code: 400 - {'error': {'message': 'Billing hard limit has been reached',"

Given we are tier 5, and we for sure didn’t exceed any hard limit. I think this is a bug. We started to experience this error from 9th of June, and today 11 of June, it is still send me the error back.


BadRequestError Traceback (most recent call last)
in
1 file_id = upload_batch_file(client, request_json)
2 # file_id = ‘file-JVOAMfShShnJWUhhAPj4’
----> 3 batch_job_id = create_batch_job(client, file_id)

in create_batch_job(client, file_id, description)
16 endpoint=“/v1/chat/completions”,
17 completion_window=“24h”,
—> 18 metadata={“description”: description}
19 )
20 print(f"Batch job created with ID: {batch_job.id}")

~/opt/anaconda3/lib/python3.7/site-packages/openai/resources/batches.py in create(self, completion_window, endpoint, input_file_id, metadata, extra_headers, extra_query, extra_body, timeout)
97 extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
98 ),
—> 99 cast_to=Batch,
100 )
101

~/opt/anaconda3/lib/python3.7/site-packages/openai/_base_client.py in post(self, path, cast_to, body, options, files, stream, stream_cls)
1238 method=“post”, url=path, json_data=body, files=to_httpx_files(files), **options
1239 )
→ 1240 return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))

→ 1020 raise self._make_status_error_from_response(err.response) from None
1021
1022 return self._process_response(

BadRequestError: Error code: 400 - {‘error’: {‘message’: ‘Billing hard limit has been reached’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: ‘billing_hard_limit_reached’}}

1 Like

Check the usage limits for the organization and the project.

https://platform.openai.com/settings/organization/limits

2 Likes

I have been contacting the support, and got fixed answers for the error "Failed to create batch job: Error code: 400 - {‘error’: {‘message’: ‘Billing hard limit has been reached’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: ‘billing_hard_limit_reached’}}
"

as following:

Hi ,

Thank you for your patience and for providing detailed information about the issue you’re encountering.

Based on the error message “Billing hard limit has been reached,” it appears that the issue is related to your organization’s spending limit rather than the rate limits for requests or tokens. Here are a few steps you can take to resolve this issue:

  1. Check Your Billing Settings:
  • Ensure that your billing settings are correctly configured and that your payment method is up to date.

  • Verify that your organization has not reached its monthly spending limit. You mentioned that you have more than $200 in your account, but it’s possible that your spending limit is set lower than your available balance.

  1. Increase Your Monthly Budget:
  • If your organization needs to continue using the API immediately, you may need to increase your monthly budget. This can typically be done by adjusting your billing settings or contacting your billing department to authorize a higher spending limit.

  • You can view and adjust your usage limits in the Limits section of your account settings.

  1. Review and Manage Usage:
  • Review your current usage to ensure that your API calls are being made efficiently. Consider whether there are any optimizations you can make to reduce the number of tokens you’re using or if there are any non-essential requests that can be paused until your budget resets.
  1. Wait for Budget Reset:
  • If increasing the budget is not an option at the moment, you may need to wait until your budget resets at the beginning of your next billing cycle.

If you have any further questions or need additional assistance, please let me know.

Best,

Aris

OpenAI Support

1 Like

BTW We are at Tier 5. The error happens when create a small batch task.

1 Like

I checked.
I don’t see in anyway I could reach the limit.

1 Like

one thing I wander is when I will stop meeting this error? since it started the day before yesterday (9th of June).

1 Like

What are the monthly budgets you have set for the organization and project?

2 Likes

I set it as 1000 USD.

I also tried using normal api call instead of batch. I still got:
An error occurred: Error code: 429 - {‘error’: {‘message’: ‘You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.’, ‘type’: ‘insufficient_quota’, ‘param’: None, ‘code’: ‘insufficient_quota’}}

and as I understand batch limit and normal api call limit are separated.
and We haven’t used normal api call for a while.

I also turned on “Auto recharge”.

1 Like

Please check if the API key used for batch processing was created under the organization account.

The tiers and API keys are different between ‘Individual’ and ‘Organization’ accounts and are not shared.

Is that for the org or the project?

There are two possible limits. You need to be aware of both.

2 Likes

I used the API key which I generated in the “Organization overview”’s “ API keys” .

1 Like

This is starting to become frustrating.

Does the app key start with sk- or sk-proj-?

When did you set the org limit to $1000? What was the previous limit?

How much has your org spent this month?

If it is a project key, what is the project budget?

This is starting to become frustrating.
Does the app key start with sk- or sk-proj-?
Yes. I tried both type.

When did you set the org limit to $1000? What was the previous limit?
The org limit to 1000 was set after the error happened. Previously was tier 2 & 20 dollars per day org limit or so.

How much has your org spent this month?
The usage for my org has been shown as 0 since 17 of May in Usage: Cost page, which is not in line with the reality.

If it is a project key, what is the project budget?
It’s the default project.

1 Like

I have reset the org maximum monthly spend to 1000 dollar. When will this error start to disappear?

“429 - You exceeded your current quota, please check your plan and billing details Cause: You have run out of credits or hit your maximum monthly spend.
Solution: Buy more credits or learn how to increase your limits.”

Is there a delay between increase limit and being able to use the api? or is it due to a bug?

What a trash service. No limit has been reached - still seeing it