Skip to main content
POST
/
v1
/
diarize
Diarize audio
curl --request POST \
  --url https://api.pyannote.ai/v1/diarize \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "https://example.com/audio.wav",
  "webhook": "https://example.com/webhook",
  "model": "precision-2",
  "numSpeakers": 2,
  "minSpeakers": 1,
  "maxSpeakers": 4,
  "turnLevelConfidence": true,
  "exclusive": true,
  "confidence": true
}'
{
  "jobId": "3c8a89a5-dcc6-4edb-a75d-ffd64739674d",
  "status": "created",
  "warning": "<string>"
}
This endpoint allows you to create a new diarization from a remote audio URL. For comprehensive guides on diarization, see these tutorials:

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
url
string
required

URL of the audio file to be processed

Example:

"https://example.com/audio.wav"

webhook
string

Webhook URL to receive results when job is completed (optional)

Example:

"https://example.com/webhook"

model
enum<string> | null
default:precision-2
Available options:
precision-1,
precision-2,
community-1
Example:

"precision-2"

numSpeakers
number

Number of speakers. Only use if the number of speakers is known in advance. Number of speakers is detected automatically if not provided. Setting this value results in better overall diarization performance. In rare cases where we cannot honor this request (e.g. short files and large number of speakers), a warning will be added to the output. Equivalent to sending minSpeakers==maxSpeakers

Required range: x >= 1
Example:

2

minSpeakers
number

Minimum number of speakers (must be <= maxSpeakers if both are set)

Required range: x >= 1
Example:

1

maxSpeakers
number

Maximum number of speakers (must be >= minSpeakers if both are set)

Required range: x >= 1
Example:

4

turnLevelConfidence
boolean | null
default:false

Includes turn-level confidence values in the output.

Example:

true

exclusive
boolean
default:false

Includes exclusive diarization values in the output in exclusiveDiarization key (equivalent to diarization but without overlapping speech).

Example:

true

confidence
boolean
default:false

Include confidence values in the output. Output is considerably larger when this option is enabled. Output includes a list of confidence scores with a resolution.

Example:

true

Response

jobId
string
required

ID of the job

Example:

"3c8a89a5-dcc6-4edb-a75d-ffd64739674d"

status
enum<string>
required

Status of the job

Available options:
pending,
created,
succeeded,
canceled,
failed,
running
Example:

"created"

warning
string

Warning message if any