Skip to Content
File uploads

Create a resumable audio upload

Permissioninference-stt:createAdd-onInferenceRetriesIdempotency-Key requiredAuthentication
POST
/inference/uploads

Creates a bounded, workspace-owned upload session for the original audio file. Upload bytes directly to signed storage URLs, rather than through the API.

The session expires after 24 hours. Outstanding upload and byte budgets are checked before storage access is issued.

Keep one stable Idempotency-Key for this logical upload. An ambiguous retry with the same payload returns its identity; changing the payload conflicts. See file jobs.

Authorization

inferenceBearerAuth
headerAuthorizationBearer <token>

Use an Inference API key. Access and keys.

Header Parameters

Idempotency-Key*string

Required. Reuse the same key to retry this write safely. Retries and idempotency.

Match^[A-Za-z0-9!#$%&'*+.^_`|~-]+$
Length1 <= length <= 255

Request Body

application/json
  1. body
filename*string
Length1 <= length <= 255
size_bytes*integer
Range1 <= value <= 5368709120
content_type*string
Length1 <= length <= 255

Response Body

Create a resumable audio upload

application/json
  1. response
id*string
Formatuuid
status*string
Value in"initiating""uploading""completing""ready""aborted""expired"
filename*string
size_bytes*integer
Range1 <= value <= 5368709120
part_size_bytes*integer
expires_at*string
Formatdate-time
parts*array<>
Example Request
curl -X POST 'https://api.kejue.co/v1/inference/uploads' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "filename": "string",  "size_bytes": 1,  "content_type": "string"}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "status": "initiating",  "filename": "string",  "size_bytes": 1,  "part_size_bytes": 16777216,  "expires_at": "2019-08-24T14:15:22Z",  "parts": [    {      "part_number": 1,      "etag": "string",      "size_bytes": 1,      "checksum_sha256": "string"    }  ]}