# `GET /v1/prices`: list prices

Source: https://bobabanana.com/docs/api/reference/list-prices/

> GET /v1/prices: list the price of each kind of job. Parameters, example request and response, and errors. BobaBanana API reference with curl, Python and...

**`GET /v1/prices` is the endpoint to list the price of each kind of job.** Free. One row per price key: `base_credits` plus `per_second_credits` for each second (rounded up) plus `per_100_chars_credits` for each started 100 characters. Rows with `pricing: live_quote` (1080p and 4K video) show the most they cost; the job's own `cost.credits_estimate` is what it holds. For the exact price of one request, send it with `dry_run: true`.

**At a glance**

- **Endpoint:** `GET /v1/prices`
- **Base URL:** `https://bobabanana.com/api/v1`
- **Auth:** `Authorization: Bearer bb_...`
- **Success:** `200`
- **Safe to retry:** yes, a read
- **Guide:** [Credits](https://bobabanana.com/docs/api/credits/)

## Request

### Headers

| Header | Required | Description |
|---|---|---|
| `Authorization` | yes | `Bearer bb_...`: your API key (or send `X-API-Key: bb_...`) |

## Example request

```bash
curl https://bobabanana.com/api/v1/prices \
  -H "Authorization: Bearer $BOBABANANA_API_KEY"
```

```python
import os

import requests

r = requests.get(
    "https://bobabanana.com/api/v1/prices",
    headers={"Authorization": f"Bearer {os.environ['BOBABANANA_API_KEY']}"},
    timeout=60,
)
r.raise_for_status()
print(r.json())
```

```javascript
const res = await fetch("https://bobabanana.com/api/v1/prices", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.BOBABANANA_API_KEY}`,
  },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
console.log(await res.json());
```

## Response

**200**: Successful Response

```json
{
  "object": "list",
  "data": [
    {
      "key": "image",
      "base_credits": 4,
      "per_second_credits": 0,
      "per_100_chars_credits": 0,
      "pricing": "fixed"
    },
    {
      "key": "video",
      "base_credits": 6,
      "per_second_credits": 2,
      "per_100_chars_credits": 0,
      "pricing": "fixed"
    },
    {
      "key": "video_1080",
      "base_credits": 10,
      "per_second_credits": 12,
      "per_100_chars_credits": 0,
      "pricing": "live_quote"
    }
  ]
}
```

## Errors

Errors use the [error object](https://bobabanana.com/docs/api/reference/objects/#error). The codes this endpoint can return (what to do about each is in [Error codes](https://bobabanana.com/docs/api/errors/)):

| Status | Code | Meaning |
|---|---|---|
| 401 | [`invalid_api_key`](https://bobabanana.com/docs/api/errors/#invalid_api_key) | The key is wrong, revoked or belongs to no workspace. |
| 401 | [`missing_api_key`](https://bobabanana.com/docs/api/errors/#missing_api_key) | No API key was sent. |
| 403 | [`workspace_suspended`](https://bobabanana.com/docs/api/errors/#workspace_suspended) | The workspace that owns the key is suspended. |
| 429 | [`too_many_attempts`](https://bobabanana.com/docs/api/errors/#too_many_attempts) | Too many requests with wrong keys came from your address. `Retry-After` is set. |
| 500 | [`internal_error`](https://bobabanana.com/docs/api/errors/#internal_error) | Something went wrong on our side. |

## Related

- Guide: [Credits](https://bobabanana.com/docs/api/credits/)
- [All endpoints](https://bobabanana.com/docs/api/reference/)
- [Objects](https://bobabanana.com/docs/api/reference/objects/)
- [Error codes](https://bobabanana.com/docs/api/errors/)
