The translate API isn't free

WARNING! This plugin can generate huge unexpected charges. In seems to check every post to detect its language and that can add up to $$$. We were surprised by a $1000 charge by Google, maybe something the developers might want to keep in mind.

That’s a huge surprise! How many posts do you have?

https://cloud.google.com/translate/pricing

We have a rather big community, however the charges were not for actual translations, but for checking the language of each post. It seems the plugin will automatically check every post when a user views it. It sent about 50k such requests in less than a month :frowning:

They charge $20 per million characters, which suggests you sent 50 million characters across the API, does that sound about right?

Whoever set this up would have been notified about charges and AFAIK translate is included in the services which qualify for $300 in free usage? Did they just “set it and forget it”?

1 Like

I haven’t looked into the character counts, sounds quite a lot. We do have topics with thousands of fairly long posts, so that might be accurate.

We haven’t received any notifications until the charge actually occurred and we’re over the free trial usage, we already have other services from Google Cloud.

Hopefully we’ll get a refund, just a caution notice for anyone using cloud services for this and in general, it feels a bit like the kid calling porn numbers :upside_down_face:

2 Likes

Fingers crossed, but they do make their API rates clear at the point of activation, so from their perspective they would have no reason to do this. The costs are right below the Enable button.

I would review who has access to the console and /admin if you have people turning on chargeable features without first estimating costs and seeking approval.

Apparently they do one off refunds, subject to investigation and bla bla bla…

The problem is just the plugin will run these language detections and it actually sends the whole content to check the language and see if a translation is actually needed. Most of our users are English speakers so very few (if any) actually translated the posts.

I think this language detection should be disabled (or disableable) or at least it should only send a small chunk of data.

I think if this was a built in problem resulting in huge charges on every post load we would have others reporting it?

API v2 from Google is a paid tier, but they have API v3 that is free. Can the plug-in be migrated to v3 for Google as it was migrated to v3 from Azure?

https://cloud.google.com/translate/pricing#prices_per_month

The pricing page states that language detection in v3 uses the same prices as v2. However,

Google does not charge extra for language detection when you do not specify the source language for the translate method; the Language Detection price applies to detect method calls.

Migrating the plugin to have category- or forum-level expectations of language and leaning on this might be better?

2 Likes

Thanks for the clarification. It does seem that v2 has two charges, language detection and then text translation. v3 is charged for language detection, but text translation is free. So all things being equal, v3 is, at most, half the cost of v2. For that alone I think v3 would be the better choice.

As for going completely free, I do agree that having the ability to set a category-level language would be a great feature.

We can accept a PR with support for API v3. #pr-welcome

4 Likes