[
    {
        "role": "user",
        "content": "give%20mapbox%20pricing%20for%20forward%20and%20reverse%20geocode"
    },
    {
        "role": "assistant",
        "content": "Here\u2019s a breakdown of Mapbox pricing for geocoding (forward & reverse), covering both *temporary* and *permanent* usage. Costs are per request, whether forward or reverse geocoding. Data is current as of late April 2026. ([mapbox.com](https://www.mapbox.com/pricing?utm_source=openai))\n\n---\n\n## Temporary vs Permanent Geocoding \u2014 What's the Difference\n\n- **Temporary Geocoding** (default):  \n  Use it for address lookups, autocomplete, reverse geocode on-the-fly. Results are **not allowed to be stored** or reused. Suitable for transient user queries or interactive search. ([docs.mapbox.com](https://docs.mapbox.com/help/dive-deeper/understand-temporary-vs-permanent-geocoding/?utm_source=openai))\n\n- **Permanent Geocoding**:  \n  Allows storage of results, use in databases, reuse across sessions. Add `permanent=true` in requests to enable. More expensive due to extended usage rights. ([docs.mapbox.com](https://docs.mapbox.com/help/dive-deeper/understand-temporary-vs-permanent-geocoding/?utm_source=openai))\n\n---\n\n## Pricing Summary: Forward & Reverse Geocoding Requests\n\nSince forward and reverse geocoding are just different request types under the Geocoding API, they share pricing. Costs depend on whether you use Temporary or Permanent geocoding and how much volume (monthly requests) you generate. ([mapbox.com](https://www.mapbox.com/pricing?utm_source=openai))\n\n| Geocoding Type | Free Tier / Minimum | Cost per 1,000 Requests | Notes |\n|----------------|----------------------|---------------------------|--------|\n| **Temporary Geocoding** (forward/reverse) | **100,000 free requests/month** | $0.75 per 1,000 for first 100k\u2013500k ([mapbox.com](https://www.mapbox.com/pricing?utm_source=openai))<br>$0.60 per 1,000 for 500,001\u20131,000,000 requests ([mapbox.com](https://www.mapbox.com/pricing?utm_source=openai))<br>$0.45 per 1,000 for 1,000,001+ ([mapbox.com](https://www.mapbox.com/pricing?utm_source=openai)) | After free tier, volume-based discounts apply. Both forward & reverse count in the same pool. |\n| **Permanent Geocoding** (forward/reverse) | No free tier | $5.00 per 1,000 up to 500,000 requests/month ([mapbox.com](https://www.mapbox.com/pricing?utm_source=openai))<br>$4.00 per 1,000 beyond 500,000 requests ([mapbox.com](https://www.mapbox.com/pricing?utm_source=openai)) | Use when you need to store & reuse results. Permanent mode must be explicitly enabled via `permanent=true`. |\n\n---\n\n## Understanding Effective Costs\n\n- If you send **forward geocoding** (e.g. \u201c123 Main St\u201d) or **reverse geocoding** (lat/lng \u2192 address), each counts equally as one Geocoding API request, under whichever mode (Temporary or Permanent).  \n- Temporary mode is much cheaper, especially for low-to-modest usage, due to the free tier.  \n- Permanent mode is 6\u201310\u00d7 more expensive, but gives legal rights to store and reuse the data.  \n\n---\n\n## Examples\n\n- If you make **150,000** geocoding (forward + reverse) requests in Temporary mode in a month:  \n  - First 100,000 requests are free.  \n  - Next 50,000 are billed at $0.75 per 1,000 \u2192 cost = **$37.50**.  \n\n- If you make **600,000** geocoding requests in Permanent mode:  \n  - First 500,000 requests billed at $5.00 per 1,000 \u2192 $2,500.  \n  - Next 100,000 at discounted rate $4.00 per 1,000 \u2192 additional $400.  \n  - Total = **$2,900**.  \n\n---\n\nIf you tell me your expected volume (e.g. # of forward, # of reverse requests per month) I can estimate your monthly cost under both Temporary & Permanent modes."
    },
    {
        "role": "user",
        "content": "so%20for%20temporary%20vs%20permanent%2C%20say%20a%20user%20wants%20to%20explore%20an%20address.%20they%20would%20use%20a%20temporary%20geocode%20request.%20but%20they%20later%20want%20to%20save%20it%20as%20a%20favorite.%20does%20this%20change%20it%20from%20a%20temporary%20to%20a%20permanent%3F"
    },
    {
        "role": "assistant",
        "content": "Yes \u2014 if a user initially uses **temporary** geocoding to explore an address, and later saves that address as a \"favorite,\" then *yes* that saved/favorite address must be handled using **permanent** geocoding rights. Here\u2019s how it works based on Mapbox\u2019s terms and documentation:\n\n---\n\n### What Mapbox Says About Temporary vs. Permanent Geocoding\n\n- **Temporary Geocoding** (default mode):  \n  You can use the result immediately \u2014 display it on a map, show it in the UI, use it during user interaction. But, **you are not allowed to store or cache** the coordinates or related results beyond the user session. ([docs.mapbox.com](https://docs.mapbox.com/help/dive-deeper/understand-temporary-vs-permanent-geocoding/?utm_source=openai))\n\n- **Permanent Geocoding**:  \n  If you want to **store** the result (e.g. in a database, in local storage), use it again later (in future sessions), or reuse it across your app (as favorites, for analytics, etc.), then you must send the request with `permanent=true`. The permanent mode gives you legal rights to cache and reuse results. ([docs.mapbox.com](https://docs.mapbox.com/api/search/geocoding/?utm_source=openai))\n\n---\n\n### Your Use Case: Exploring, Then Saving as Favorite\n\n- **Explore step (temporary geocoding):**  \n  The user searches for an address or drops a pin. You call the Mapbox Geocoding API *without* `permanent=true`. That\u2019s compliant with temporary usage \u2014 no saving, just display/use in that session.  \n\n- **Save as favorite:**  \n  Now you need to persist that geocoded result (e.g. coordinates, formatted address) in your database or local storage. Since persistence is involved, you must use **permanent geocoding**. That means re-querying (or re-recording) using the API with `permanent=true` so you acquire the **permanent usage rights** for that result. Simply storing something you got under temporary doesn\u2019t grant those rights. Mapbox explicitly ties storage rights to the permanent geocode. ([docs.mapbox.com](https://docs.mapbox.com/api/search/geocoding/?utm_source=openai))\n\n---\n\n### Practical Steps: How to Implement This\n\nHere\u2019s what your flow might look like:\n\n1. **User explores address**  \n   - Use forward or reverse geocoding API  \n   - Do *not* set `permanent=true`  \n   - Display result, let them inspect it\n\n2. **User clicks \"Save favorite\"**  \n   - Perform another geocoding API request for the same address/coordinates, this time **with** `&permanent=true`  \n   - Save the result you get (coordinates, place names, etc.)\n\n3. **Store & reuse**  \n   - You can now store these results and show favorites without hitting the API again  \n   - Since you used `permanent=true`, storage and reuse are allowed\n\n---\n\nIf you\u2019d like, I can show you sample API calls for temporary vs. permanent geocoding \u2014 or estimate any cost difference for your projected usage."
    },
    {
        "role": "user",
        "content": "so%20when%20user%20saves%20the%20address%2C%20do%20we%20do%20a%20whole%20new%20query%20or%20just%20update%20the%20existing%20one%20to%20get%20the%20permanent%20rights%3F"
    },
    {
        "role": "assistant",
        "content": "You **can\u2019t** just \u201cupgrade\u201d a temporary geocoding result to permanent rights by updating the existing one\u2014at least not under Mapbox\u2019s terms. You\u2019ll need to make a **new geocoding request** with `permanent=true`. Here's how and why (with references).\n\n---\n\n## What the Policy Says\n\n- Mapbox defines:  \n  - A **Temporary Geocode** is one produced without `permanent=true`. These cannot be stored, cached, or reused. ([docs.mapbox.com](https://docs.mapbox.com/help/dive-deeper/understand-temporary-vs-permanent-geocoding/?utm_source=openai))  \n  - A **Permanent Geocode** is one produced with `permanent=true`. Only permanent geocodes may be stored for reuse and long-term persistence. ([docs.mapbox.com](https://docs.mapbox.com/help/dive-deeper/understand-temporary-vs-permanent-geocoding/?utm_source=openai))  \n\n- Direct users of the Mapbox Search JS SDK are told: *\u201cresults from the Mapbox Geocoding API should use the `permanent=true` flag if the results are to be cached/stored in a customer database. Otherwise, results should be used ephemerally and not persisted.\u201d* ([docs.mapbox.com](https://docs.mapbox.com/mapbox-search-js/api/core/geocoding/?utm_source=openai))\n\n- The Product Terms make a distinction:  \n  - Mapbox.geocoding with `mapbox.places` = temporary mode.  \n  - Mapbox.places-permanent or requests *with* `permanent=true` = permanent mode. ([assets-global.website-files.com](https://assets-global.website-files.com/5d4296d7a839ea49599adba1/6609f33f5ac2ae69b3a2de50_Mapbox%20Product%20Terms%20%282024-03-31%29.pdf?utm_source=openai))\n\n---\n\n## What This Means for Your Workflow\n\nGiven the policy, here's the practical implication:\n\n- **If the user explores** (temporary mode):  \n  You call geocoding without `permanent=true`. You display the result immediately, but you **don\u2019t store** it beyond the session. Even storing the latitude/longitude or address locally is not permitted under temporary mode. ([docs.mapbox.com](https://docs.mapbox.com/help/dive-deeper/understand-temporary-vs-permanent-geocoding/?utm_source=openai))\n\n- **If the user saves the address/favorite**:  \n  You need to call geocoding *again*, this time with `permanent=true`, to get a permanent geocode. That fetch gives you the rights to store the result in your database. You should then use *that* permanent geocode going forward.  \n\n  Using the temporary result that was already fetched doesn\u2019t give you the legal right to store it permanently. Only the results returned from a request with `permanent=true` are covered. ([docs.mapbox.com](https://docs.mapbox.com/mapbox-search-js/api/core/geocoding/?utm_source=openai))\n\n---\n\n## Example Flow\n\n1. **Explore step**  \n   Request:  \n   ```\n   GET https://api.mapbox.com/geocoding/v5/mapbox.places/123%20Main%20St.json?\n       access_token=...               # no permanent=true\n   ```\n   - Use the result temporarily for display.\n   - Do *not* store it.\n\n2. **User saves as favorite**  \n   Request again:  \n   ```\n   GET https://api.mapbox.com/geocoding/v5/mapbox.places/123%20Main%20St.json?\n       access_token=...&permanent=true\n   ```\n   - Use this response\u2019s data (coordinates / address) in your DB.\n   - From now on, use the stored permanent result for displaying the favorite \u2014 no need to re-request.\n\n---\n\nIf you want, I can draft some sample code demonstrating how to do this in your stack (e.g. JavaScript / Python)."
    }
]