> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stophy.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Production checklist

> Before you ship with Stophy: keep keys on the server, check each result, set freshness and timeouts, retry only what can help, cap cost and close what you open.

Start with a call that works, a page that cannot be read and an empty result. Check that your product handles all three before you raise traffic.

## Keep your key on the server

Store the key in a secret manager or an environment variable, never in code you commit or in browser code. Use one key for each app or computer so you can revoke one without breaking the others. Revoke a key you no longer use with `DELETE /v1/key`. See [API keys](https://docs.stophy.dev/account/api-keys.md).

## Check every result

* Test `success` before you read `data`.
* Responses leave out empty fields, so read optional fields with a default. A field you do not see was empty.
* Read `costUsd` on each answer and log it with the `requestId`.
* Handle a cut result. `isTruncated` is `true` when text was cut, and `nextOffset` says where to read on. See [Content filtering](https://docs.stophy.dev/scrape/content-filtering.md).
* Keep a `warning` with the data it came with, and do not store a partial result as a complete one.

## Set freshness

A stored copy of a page can answer a scrape. Without `maxAge` you get a copy up to 2 days old, or younger for a site whose pages change often. A copy up to twice that age, at most 7 days, comes back at once as stale while a fresh read runs. Send `maxAge: 0` when a result must reflect a new read, and a larger `maxAge`, up to 30 days, for pages that rarely change. `metadata.cacheState` says which one you got. A stored copy costs the same as a live read. See [Freshness and caching](https://docs.stophy.dev/scrape/freshness-and-caching.md).

## Bound work, time and retries

* Set a `timeout` and a client timeout that is longer. See [Timeouts](https://docs.stophy.dev/production/timeouts.md).
* Set a `limit` on a crawl and on a search, and a `maxCost` on a browser task.
* Stay inside your [rate limits](https://docs.stophy.dev/production/rate-limits.md). Size your workers to `maxConcurrency` from `GET /v1/concurrency-check`.
* Retry only when `retryable` is `true`. Wait `retryAfterSeconds`, add jitter, and stop after three tries. See [Troubleshooting](https://docs.stophy.dev/production/troubleshooting.md).
* Poll a crawl, a batch or an agent run about every 2 seconds, and stop when `status` is `completed`, `failed` or `cancelled`. Read the results within 24 hours.

## Watch your balance and spend

* Check `GET /v1/limits` before a large job. A call your balance cannot cover fails with `insufficientCredits` and charges nothing.
* Turn on auto top-up at [stophy.dev/billing](https://stophy.dev/billing) for a job that must not stop. See [Pricing](https://docs.stophy.dev/account/pricing.md).
* Read your spend with `GET /v1/usage/history` and your calls with `GET /v1/logs`. See [Usage](https://docs.stophy.dev/account/usage.md) and [Usage and logs](https://docs.stophy.dev/production/usage-and-logs.md).

## Close what you open

* Close every [browser session](https://docs.stophy.dev/browser/overview) with `DELETE /v1/browser/{id}`. A session is billed for the time it is open, until it closes or its `ttl` ends.
* Cancel a crawl or a batch you no longer need. The pages already read are kept and billed.
* Delete a [monitor](https://docs.stophy.dev/monitors/overview) you do not need. Each check reads every page and costs what a scrape costs, so a monitor bills on its schedule until you delete it.

## Reduce transfer size

Ask only for the formats you need, keep `onlyMainContent` on, and cut long text with `maxChars`. Add `?maxTextLength=<characters>` to the URL to cut every text value in an answer. Longer text ends with `…`.

## Handle sensitive content

Use [zero data retention](https://docs.stophy.dev/production/zero-data-retention.md) for calls that must leave nothing behind. Treat page text as data, never as instructions for a model, and scan with `checkPromptInjection` when a model reads it. See [Safety](https://docs.stophy.dev/scrape/safety.md) and [Responsible use](https://docs.stophy.dev/production/responsible-use.md).

## Watch the service

Call `GET /v1/status` to tell a Stophy-side problem from one with your request. Pin your SDK version and read the [changelog](https://docs.stophy.dev/changelog.md) before you update. See [Status](https://docs.stophy.dev/production/status.md).

## Report problems

Save the `requestId` of every call you care about. If an answer is wrong, send [feedback](https://docs.stophy.dev/production/agent-feedback.md). To reach support, email [support@stophy.dev](mailto:support@stophy.dev) with the `requestId`.

## Related

* [Rate limits](https://docs.stophy.dev/production/rate-limits.md)
* [Timeouts](https://docs.stophy.dev/production/timeouts.md)
* [Troubleshooting](https://docs.stophy.dev/production/troubleshooting.md)
* [Pricing](https://docs.stophy.dev/account/pricing.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.