The AWS Simple Storage Service (S3) can be used as a source for jobs. If your audio already resides on S3, you can process it there directly with pyannoteAI APIs by providing temporary access credentials to your data.

Pre-Signed URLs

A pre-signed URL can be a convenient way to provide a URL containing temporary credentials as a basic string. pyannoteAI Jobs APIs need to GET the url parameter when reading it. Therefore, to make a request with pre-signed URLs, you’ll need to generate it.

Here’s an example for how to do this:

generate-signed-url.py

# pip install boto3

import boto3
from botocore.exceptions import ClientError

def create_presigned_url(bucket_name, object_name,
                         operation='get_object', expiration=3600):
    client = boto3.client('s3')
    try:
        return client.generate_presigned_url(operation,
                Params={'Bucket': bucket_name, 'Key': object_name},
                ExpiresIn=expiration
                )
    except ClientError as e:
        print(e)


# Use the presigned URL as the input parameter
signed_url = presign.create_presigned_url('your-bucket-name', 'object/name.mp3')

request = {
 'url': signed_url,
}

# ... send the request to the Job API

For further examples, see the AWS documentation on Creating a pre-signed URL for Amazon S3.