Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions src/content/docs/ai-gateway/providers/cartesia.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Cartesia
pcx_content_type: get-started
sidebar:
badge:
text: Beta
---

[Cartesia](https://docs.cartesia.ai/) provides advanced text-to-speech services with customizable voice models.

## Endpoint

```txt
https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/cartesia
```

## URL Structure

When making requests to Cartesia, replace `https://api.cartesia.ai/v1` in the URL you are currently using with `https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/cartesia`.

## Prerequisites

When making requests to Cartesia, ensure you have the following:

- Your AI Gateway Account ID.
- Your AI Gateway gateway name.
- An active Cartesia API token.
- The model ID and voice ID for the Cartesia voice model you want to use.

## Example

### cURL

```bash title="Request"
curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/cartesia/tts/bytes \
--header 'Content-Type: application/json' \
--header 'Cartesia-Version: 2024-06-10' \
--header 'X-API-Key: {cartesia_api_token}' \
--data '{
"transcript": "Welcome to Cloudflare - AI Gateway!",
"model_id": "sonic-english",
"voice": {
"mode": "id",
"id": "694f9389-aac1-45b6-b726-9d9369183238"
},
"output_format": {
"container": "wav",
"encoding": "pcm_f32le",
"sample_rate": 44100
}
}
```
Loading