---
title: "Count tokens (Bedrock format)"
method: POST
path: "/bedrock/model/{modelId}/count-tokens"
tags: ["Bedrock Integration"]
---

# Count tokens (Bedrock format)

`POST /bedrock/model/{modelId}/count-tokens`

Counts tokens for a Converse-style request using AWS Bedrock format.
The request body must include `input.converse` with a complete Converse
payload; only Converse-shaped input is supported.

## Path parameters

- `modelId` string, required

## Request body

- object
  - `input` object, required
    - `converse` object, required — Converse-shaped request used to compute the token count.

## Response `200`

Successful response

- object
  - `inputTokens` integer — Number of input tokens that would be billed for this request.

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

[API](https://skmtc.net/getbifrost/apis/bifrost-api.md) · [All operations](https://skmtc.net/getbifrost/apis/bifrost-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbifrost/bifrost-api/versions/f8cab88f64ea/schema)
