← Back to Blog

Openai costs building up

Openai costs building up 106 calls 50 fails > https://portal.azure.com/#@pexabo.com/resource/subscriptions/ad744a08-2411-4d78-b417-1f1c83f4f741/resourceGroups/ContractorMarketing/providers/Microsoft.Logic/workflows/contractormarketing-gpt-coverletter/logicApp maybe it is time

Openai costs building up

openai costs building 1

openai costs building 2

openai costs building 3

openai costs building 4

openai costs building 5

openai costs building 6

106 calls 50 fails >https://portal.azure.com/#@pexabo.com/resource/subscriptions/ad744a08-2411-4d78-b417-1f1c83f4f741/resourceGroups/ContractorMarketing/providers/Microsoft.Logic/workflows/contractormarketing-gpt-coverletter/logicApp

openai costs building 7

maybe it is time to down grade for a cheaper model

openai costs building 8

The pricing for OpenAI API calls varies depending on the model and the specific usage. Here's a breakdown of some of the key costs associated with different models:

  • GPT-3.5 Turbo:

  • Input: $0.0015 per 1,000 tokens

  • Output: $0.002 per 1,000 tokens

  • GPT-4 Turbo:

  • Input: $0.03 per 1,000 tokens

  • Output: $0.06 per 1,000 tokens

  • Text-Embedding Models:

  • For example, text-embedding-3-large costs $0.00013 per 1,000 tokens.

  • Older Models:

  • Ada: $0.0008 per 1,000 tokens

  • Babbage: $0.0012 per 1,000 tokens

  • Curie: $0.006 per 1,000 tokens

  • Davinci: $0.06 per 1,000 tokens

For a specific call, if you were charged $5 for 150 units, it translates to approximately $0.033 per unit. This would be significantly higher than typical costs per token for text models, suggesting a different pricing structure or model might be involved, potentially involving image generation or more complex operations.

For more detailed and updated information, you can visit OpenAI's pricing page【9†source】【10†source】【13†source】【14†source】.

Updated the model name

openai costs building 9

after the error

openai costs building 10

The error message indicates that either the model gpt-3.5 does not exist or you do not have access to it. Here are some possible reasons and steps to resolve the issue:

  • Model Availability:

  • Ensure that the model name is correctly specified. For example, the correct model names include gpt-3.5-turbo, gpt-3.5-turbo-0301, etc. The exact model name must match what is available in the OpenAI API documentation.

  • Access Permissions:

  • Check if your API key has the necessary permissions to access the specified model. Access to certain models might be restricted based on your subscription plan or account settings.

  • Subscription Plan:

  • Verify that your subscription plan includes access to the model you are trying to use. Some models might only be available under certain plans.

  • Account Configuration:

  • Ensure that your OpenAI account is properly configured. You might need to enable certain settings or upgrade your account to gain access to specific models.

Steps to Troubleshoot

  • Verify Model Name:

  • Double-check the model name in your API request. For example, use gpt-3.5-turbo instead of gpt-3.5.

  • Check API Documentation:

  • Review the OpenAI API documentation to ensure you are using a valid model name and have the necessary access.

  • Update API Key:

  • Ensure your API key is valid and has not expired. If necessary, generate a new API key from your OpenAI account dashboard.

  • Account and Subscription:

  • Log in to your OpenAI account and check your subscription plan and model access permissions. You might need to upgrade your plan or request access to specific models.

  • Contact Support:

  • If the issue persists, contact OpenAI support for assistance. Provide them with the error message and details about your account and API request.

By following these steps, you should be able to identify and resolve the issue with accessing the gpt-3.5 model.

Testing runid > https://portal.azure.com/#view/Microsoft_Azure_EMA/LogicAppsMonitorBlade/runid/%2Fsubscriptions%2Fad744a08-2411-4d78-b417-1f1c83f4f741%2FresourceGroups%2FContractorMarketing%2Fproviders%2FMicrosoft.Logic%2Fworkflows%2Fcontractormarketing-gpt-coverletter%2Fruns%2F08584840039695503712367133215CU31

it can generate the output

openai costs building 11

The error message indicates that either the model gpt-3.5 does not exist or you do not have access to it. Here are some possible reasons and steps to resolve the issue:

  • Model Availability:

  • Ensure that the model name is correctly specified. For example, the correct model names include gpt-3.5-turbo, gpt-3.5-turbo-0301, etc. The exact model name must match what is available in the OpenAI API documentation.

  • Access Permissions:

  • Check if your API key has the necessary permissions to access the specified model. Access to certain models might be restricted based on your subscription plan or account settings.

  • Subscription Plan:

  • Verify that your subscription plan includes access to the model you are trying to use. Some models might only be available under certain plans.

  • Account Configuration:

  • Ensure that your OpenAI account is properly configured. You might need to enable certain settings or upgrade your account to gain access to specific models.

Steps to Troubleshoot

  • Verify Model Name:

  • Double-check the model name in your API request. For example, use gpt-3.5-turbo instead of gpt-3.5.

  • Check API Documentation:

  • Review the OpenAI API documentation to ensure you are using a valid model name and have the necessary access.

  • Update API Key:

  • Ensure your API key is valid and has not expired. If necessary, generate a new API key from your OpenAI account dashboard.

  • Account and Subscription:

  • Log in to your OpenAI account and check your subscription plan and model access permissions. You might need to upgrade your plan or request access to specific models.

  • Contact Support:

  • If the issue persists, contact OpenAI support for assistance. Provide them with the error message and details about your account and API request.

By following these steps, you should be able to identify and resolve the issue with accessing the gpt-3.5 model.


SAVED 73 DOLLARS FOR NOW

To calculate the cost savings when switching from GPT-4 to GPT-3.5-turbo-0301, we need to compare the costs for the same usage. Let's use the pricing provided:

  • GPT-4 costs:

  • Input: $0.03 per 1,000 tokens

  • Output: $0.06 per 1,000 tokens

  • GPT-3.5-turbo-0301 costs:

  • Input: $0.0015 per 1,000 tokens

  • Output: $0.002 per 1,000 tokens

Assuming your usage translates to $80 per month on GPT-4, let's break down the costs and then apply them to GPT-3.5-turbo-0301.

Calculation for GPT-4

Let's say your monthly usage in terms of tokens is:

  • ( X ) tokens for input

  • ( Y ) tokens for output

The total cost is then:
[ 80 = (X \times 0.03) + (Y \times 0.06) ]

Calculation for GPT-3.5-turbo-0301

Using the same ( X ) and ( Y ) tokens, the cost for GPT-3.5-turbo-0301 would be:
[ \text{New cost} = (X \times 0.0015) + (Y \times 0.002) ]

Ratio of Costs

The cost ratio between GPT-4 and GPT-3.5-turbo-0301 for both input and output tokens is:
[ \text{Input cost ratio} = \frac{0.0015}{0.03} = 0.05 ]
[ \text{Output cost ratio} = \frac{0.002}{0.06} = 0.0333 ]

Applying the Cost Ratios

If the original cost on GPT-4 is $80:

  • 5% of the cost is attributed to input tokens.

  • 3.33% of the cost is attributed to output tokens.

Therefore, the total new cost on GPT-3.5-turbo-0301 would be:
[ \text{New cost} = 80 \times 0.05 + 80 \times 0.0333 ]
[ \text{New cost} = 4 + 2.664 ]
[ \text{New cost} = 6.664 ]

Cost Savings

The cost savings can be calculated as:
[ \text{Savings} = 80 - 6.664 ]
[ \text{Savings} = 73.336 ]

Conclusion

By switching from GPT-4 to GPT-3.5-turbo-0301, you would save approximately $73.34 per month.


Imported from rifaterdemsahin.com · 2024