reapit / foundations

Foundations platform mono repo
57 stars 21 forks source link

Billing Question #10118

Closed chestertons closed 10 months ago

chestertons commented 10 months ago

Still trying to fully understand pricing - for properties api, embedding images, the calculator says:

Initial seed calls: (700 / 100) + ((700 * 15) / 100) = 112 API Calls

Not sure how the system calculates for embedded images - does it treat 1 image returned as 1/100 of an "API Call"?

In which case for seeding / daily updating, does it make more sense to load the properties in one run, then load the images in another? And for updates, not to take the images at all, since 99% of images will not have been updated...

chestertons commented 10 months ago

https://github.com/reapit/foundations/issues/5935 seems to deal, but it indicates that embedding is by far more the more expensive. To the question

"If there are 10 properties that each have 10 images, does this count as 11 total endpoint requests (1 for the property and one for each of the properties images) or 2 (one for the properties and one for all the images associated with these properties)."

the answer came

"they will be charged as separate requests"

Ie, If I'm downloading a page of 100 properties, each of which has 10 images, the API call is some calculation based on 100 (properties) + 1000 (images) = 1100 ... somethings :)

plittlewood-rpt commented 10 months ago

Hi @chestertons

Embedding is a convenience mechanism and makes no difference to billing compared with if you made the requests yourself. If you download a page of 100 properties and choose to embed images, If each property has 10 images we make 100 calls to the property images API on your behalf (as there are 1000 images in total, and we're running with a page size of 100). Therefore we end up making 101 calls in total (1 for the call to GET /properties and the 100 we make on your behalf for the embedding).

The page size you issue in your request gets passed down to any embed calls, so it gets retained throughout. If you fetched your 100 properties using a pageSize of 50, you'd end up making double the number of calls and being billed accordingly.

I hope this helps answer your question. Let me know if you need any further clarification. Some developers choose not to use embedding because they'd prefer to be in control of all the calls they make. This is fine too, as it makes no difference to the way you are billed.

Thanks Pete

chestertons commented 10 months ago

Thanks, for clarity and our accounts department, assuming 1 api call costs £0.01

If we're downloading a page of 100 properties = 1 api call

plittlewood-rpt commented 10 months ago

Not necessarily, it depends how many images and documents each property has. You'll get different behaviour if one of the properties has 50 documents attached. You are also billed differently depending on how many endpoints you utilise (bearing in mind any embed calls are treated as though you made the call yourself, so in your example above you'd be using 4 endpoints). 301 API calls would be £3.01 not £0.31. You can use the Cost Calculator in the developer portal (Under Analytics -> Cost Calculator) to understand the calculations. You can also refer to Schedule 2 in the Developer Terms and Conditions for more information

chestertons commented 10 months ago

£3.01 - you're right!

the calculator doesn't seem to work in the way you describe

(100/ 100) + ((100 * 15) / 100) suggests that each embedded record returned = 1/100 of an API Call?

plittlewood-rpt commented 10 months ago

That’s right but only when you are querying with a page size of 100. It’s an odd way to look at it. If you run your calculations with a different page size that won’t be true as we will end up needing to make more calls on your behalf to complete all the embed operations. Thanks


From: chestertons @.> Sent: Friday, November 10, 2023 5:32:04 PM To: reapit/foundations @.> Cc: Pete Littlewood @.>; Assign @.> Subject: [EXTERNAL] Re: [reapit/foundations] Billing Question (Issue #10118)

External Message - Please be cautious when opening links or attachments in email


£3.01 - you're right!

the calculator doesn't seem to work in the way you describe

(100/ 100) + ((100 * 15) / 100) suggests that each embedded record returned = 1/100 of an API Call?

— Reply to this email directly, view it on GitHubhttps://github.com/reapit/foundations/issues/10118#issuecomment-1806143415, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHK7GI7VT2JG7Y2MB4Q46MTYDZQJJAVCNFSM6AAAAAA7EYJEIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWGE2DGNBRGU. You are receiving this because you were assigned.Message ID: @.***>

plittlewood-rpt commented 10 months ago

Hi @chestertons - do you need any further assistance with the above? We will close this issue down in the next day or so if there is no further correspondence. Thanks