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

# Responses & errors

> The response envelope, credit costs, and how errors are reported.

## The response envelope

Every successful response shares the same shape. Your result is always in
`data`; the two metadata fields tell you what the call cost and how long it
took.

```json theme={null}
{
  "timeMs": 842,
  "creditsCost": 1,
  "data": {}
}
```

<ResponseField name="data" type="object | array">
  The scraped result. Its shape depends on the endpoint — see the [API
  Reference](/api-reference) for each one. Some endpoints return a single
  object, others return an array.
</ResponseField>

<ResponseField name="creditsCost" type="number">
  Credits this request consumed. Every endpoint costs exactly **1 credit**.
</ResponseField>

<ResponseField name="timeMs" type="number">
  Wall-clock time the request took, in milliseconds.
</ResponseField>

## Credits

Bridgly is pay-as-you-go: **one credit per successful call**, on every endpoint.
Credits never expire, and you can enable auto top-up from the **Billing** page
so you never run dry mid-job. Failed calls (validation errors, not-found, and
server errors) are not charged.

## Errors

When something goes wrong, the response uses a uniform error body instead of the
envelope:

```json theme={null}
{
  "status": "error",
  "message": "Human-readable description of what went wrong."
}
```

The HTTP status code tells you the category:

| Status | Meaning                                        | What to do                                                          |
| ------ | ---------------------------------------------- | ------------------------------------------------------------------- |
| `400`  | Bad request — the JSON body failed validation. | Check the endpoint's schema in the [API Reference](/api-reference). |
| `401`  | Missing, malformed, or revoked API key.        | Verify the `Authorization` header and that the key is active.       |
| `402`  | Out of credits.                                | Top up on the **Billing** page of your dashboard.                   |
| `404`  | The requested resource wasn't found.           | Confirm the identifier (username, URL, slug) exists and is public.  |
| `500`  | The scrape failed unexpectedly.                | Retry after a short delay; contact support if it persists.          |

<Tip>
  Always branch on the HTTP status code rather than parsing the message string —
  messages are meant for humans and may change.
</Tip>
