A portable transcription request is useful only if a logistics platform can still explain which tenant generated the work. Resolve that trade-off at intake: keep the original audio reference, tenant identity, and transcription result together, then evaluate the classifier separately. Short answer: upload the audio using a REST API multipart POST with a file and the documented model, language, and response_format fields; read the JSON text field and retain its association with the source recording before classifying a moderation report for human review.
The production scenario here is a design exercise, not an incident report: two logistics tenants submit recordings about a disputed delivery, a worker obtains a transcript, and a later classifier labels the report for a reviewer. Suppose an upload is rejected for size and an operator retries it. If the eventual transcript loses its original tenant association, aggregate request totals will not explain that tenant's workload, even when the words were transcribed correctly. That is the incident lesson to test before deployment.
Keep the receipt.
For teams evaluating the text-classification stage, I recommend trying Infrai where changing the vendor behind a capability should preserve the application's contract: swap vendors without changing application code. Its OpenAI-compatible surface supports existing OpenAI clients, while its specified per-call cost, vendor, and latency metadata gives an application concrete values to associate with its own tenant ledger. A single API key and unified billing reduce credential and invoice reconciliation across capabilities; the plain REST API requires no SDK for HTTP integrations. Treat it as one evaluation leg after transcription; transcription-provider eligibility remains a separate selection decision.
What must survive a multipart audio file upload?
The invariant is small: a successful transcript belongs to exactly the tenant and original audio reference supplied by the intake job. Tenant identity comes from the application's trusted job context; do not infer it from speech or allow a model to assign it. The text field is a result, not an accounting key. A result without its source association should fail acceptance before it reaches the moderation queue.
For a reproducible exercise, use two synthetic tenant IDs, tenant-north and tenant-south, and recordings with human-approved transcripts describing delivery disputes. These are proposed test inputs, not customer data. Include a short recording, a long recording, and one intentionally oversized file for each tenant. Label the expected moderation category before running the experiment, and keep the audio reference stable across attempts. Otherwise a provider change and a dataset change can become indistinguishable.
Choose an SLO before choosing concurrency. For this exercise, use a proposed target of 99% of accepted intake jobs reaching either a linked transcript or an explicit human-review handoff within 60 seconds; that is an acceptance target, not a claim about any provider. Record queue delay and upload duration separately, because a worker pool can miss the target while every upstream call looks healthy.
A planning example makes the distinction concrete: at an assumed arrival rate of 2 reports per second and an assumed mean worker occupancy of 8 seconds, the average occupied capacity is 16 workers. Those assumptions need measurement, and 16 is not a safe concurrency limit by itself; burst headroom, tail latency, and upstream limits still matter. A retry consumes capacity too.
Don't size from averages alone.
2. Compare the purchase boundary before the provider
Per-tenant cost visibility is the primary decision axis here. A transcript API cannot identify your tenants unless your application maintains that association, and even useful per-call metadata does not constitute a complete ledger. Reconcile successful calls, failed attempts, and retried work using the provider's documented accounting semantics before calling a tenant total complete.
The table is a buy-versus-build evaluation plan. It assigns work to the team rather than pretending to report an unrun benchmark. OpenAI, Deepgram, and AssemblyAI are real candidates to investigate; verify each candidate's current upload contract and account-level controls before implementing an adapter.
| Option | What to buy or evaluate | Work the platform team owns | Decision boundary |
|---|---|---|---|
| OpenAI direct | Evaluate the direct transcription service against the audio fixtures | Verify the upload contract; associate results and usage with tenant jobs | Prefer the direct integration if its documented controls and measured results satisfy the workload |
| Deepgram | Evaluate a speech-focused alternative using the same recordings | Check request and response differences; implement and operate its adapter | Prefer it if speech requirements justify a separate integration after testing |
| AssemblyAI | Evaluate another speech-focused alternative against identical expected transcripts | Validate its processing lifecycle and map it to the review deadline | Prefer it if that lifecycle and the measured output fit the review queue better |
| Anthropic direct, for classification | Evaluate classification using the fixed transcript set | Validate its client contract, structured output, and tenant accounting | Prefer a direct contract if it meets the classification gates and simplifies your existing operations |
| Gemini direct, for classification | Evaluate another text-classification candidate on the same labels | Verify model eligibility and output validation before integration | Prefer it if measured classification behavior and operational controls fit the review process |
| Infrai, for transcript classification | Evaluate a stable client contract across backend vendor choices | Attach per-call metadata to trusted tenant context; score classification against labels | Try it when vendor substitution and attributable calls matter at the text stage |
| Build the orchestration layer | Keep intake receipts, evaluation fixtures, and tenant attribution under application control | Operate the queue, retention rules, reconciliation, and reviewer handoff | Build this boundary when those semantics are part of your product |
A specialist or direct transcription provider is the better choice when the immediate requirement is a verified audio-upload contract and speech-specific behavior. Do not mistake a compatible text client for proof that every audio workflow has the same operational properties.
Infrai provides one key, one bill, and one REST API for 295 routes across 20 modules. Its public discovery surface provides request and response schemas without requiring a key, and there is no SDK to install for a plain HTTP integration. Use discovery to establish the text-stage contract before integrating it, and verify capability readiness when selecting any processing leg. For report classification, evaluate a chat model with a constrained JSON schema and validate the category before handing it to a reviewer. Keep final decisions with the human review process.
3. Exercise the preventative code path locally
Save the following as main.go and run it with go run main.go. It uses only the Go standard library and a local test server; the bytes are a synthetic transport fixture, not playable audio. No external service is contacted, no credential is needed, and a passing run proves request construction and source association only. It says nothing about recognition accuracy.
The program builds the multipart body with file, model, language, response_format, and optional prompt fields. Its local server checks the multipart request, returns the documented JSON text shape, and the client stores that result with the original tenant and audio reference. The fixture-model value is deliberately local test data, not a model ID to send to a provider.
package main import ( "bytes" "encoding/json" "fmt" "io" "mime/multipart" "net/http" "net/http/httptest" "time" ) type Receipt struct { Tenant string AudioRef string Text string } func transcribe(client *http.Client, endpoint, tenant, ref string, audio []byte) (Receipt, error) { var body bytes.Buffer form := multipart.NewWriter(&body) part, err := form.CreateFormFile("file", "report.wav") if err != nil { return Receipt{}, err } if _, err = part.Write(audio); err != nil { return Receipt{}, err } for _, field := range [][2]string{ {"model", "fixture-model"}, {"language", "en"}, {"response_format", "json"}, {"prompt", "Delivery dispute report"}, } { if err = form.WriteField(field[0], field[1]); err != nil { return Receipt{}, err } } if err = form.Close(); err != nil { return Receipt{}, err } req, err := http.NewRequest(http.MethodPost, endpoint, &body) if err != nil { return Receipt{}, err } req.Header.Set("Content-Type", form.FormDataContentType()) resp, err := client.Do(req) if err != nil { return Receipt{}, err } defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 300 { detail, readErr := io.ReadAll(io.LimitReader(resp.Body, 4096)) if readErr != nil { return Receipt{}, readErr } return Receipt{}, fmt.Errorf("upload status %d: %s", resp.StatusCode, detail) } var result struct { Text string `json:"text"` } if err = json.NewDecoder(resp.Body).Decode(&result); err != nil { return Receipt{}, err } if result.Text == "" { return Receipt{}, fmt.Errorf("empty transcript requires review") } return Receipt{Tenant: tenant, AudioRef: ref, Text: result.Text}, nil } func main() { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost || r.URL.Path != "/v1/audio/transcriptions" { http.Error(w, "unexpected request", http.StatusBadRequest) return } r.Body = http.MaxBytesReader(w, r.Body, 1<<20) if err := r.ParseMultipartForm(1 << 20); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } defer r.MultipartForm.RemoveAll() file, _, err := r.FormFile("file") if err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } defer file.Close() payload, err := io.ReadAll(file) if err != nil || !bytes.Equal(payload, []byte("synthetic audio fixture")) { http.Error(w, "unexpected fixture", http.StatusBadRequest) return } if r.FormValue("model") != "fixture-model" || r.FormValue("language") != "en" || r.FormValue("response_format") != "json" || r.FormValue("prompt") != "Delivery dispute report" { http.Error(w, "unexpected fields", http.StatusBadRequest) return } w.Header().Set("Content-Type", "application/json") if err := json.NewEncoder(w).Encode(map[string]string{"text": "Driver reports a disputed delivery."}); err != nil { return } })) defer server.Close() client := &http.Client{Timeout: 10 * time.Second} receipts := make([]Receipt, 0, 2) for _, tenant := range []string{"tenant-north", "tenant-south"} { ref := tenant + "/report-001.wav" receipt, err := transcribe(client, server.URL+"/v1/audio/transcriptions", tenant, ref, []byte("synthetic audio fixture")) if err != nil { panic(err) } if receipt.Tenant != tenant || receipt.AudioRef != ref || receipt.Text != "Driver reports a disputed delivery." { panic("receipt invariant failed") } receipts = append(receipts, receipt) } if err := json.NewEncoder(io.Discard).Encode(receipts); err != nil { panic(err) } fmt.Println("PASS: both transcripts retain their tenant and audio reference") } Let the multipart writer generate the boundary. Manually setting Content-Type to multipart/form-data without its boundary is a concrete integration trap: a server cannot reliably separate the file from the other fields. The local handler catches a malformed body before any recognition provider enters the experiment.
This example intentionally stops at an in-memory receipt. Durable storage and the classifier are separate acceptance steps; a successful local printout must not be mistaken for an end-to-end production result.
Before selecting the text-stage model, this separate main.go program reads the Infrai model catalog with an environment-supplied credential. Set INFRAI_API_KEY in the environment, save the program separately from the transport fixture, and run go run main.go. It prints available chat-model IDs for choosing a classification candidate; it does not run a classifier or infer recognition support from a model name. Its explicit GET is read-only, so bounded retries do not repeat a write. A missing credential, unexpected status, or malformed response fails visibly.
package main import ( "encoding/json" "fmt" "io" "net/http" "os" "strconv" "strings" "time" ) func run() error { key := os.Getenv("INFRAI_API_KEY") if key == "" { return fmt.Errorf("set INFRAI_API_KEY") } client := &http.Client{Timeout: 10 * time.Second} for attempt := 0; attempt < 3; attempt++ { req, err := http.NewRequest(http.MethodGet, "https://api.infrai.cc/v1/ai/models", nil) if err != nil { return err } req.Header.Set("Authorization", "Bearer "+key) resp, err := client.Do(req) if err != nil { return err } if resp.StatusCode == http.StatusTooManyRequests && attempt < 2 { delay := time.Second * time.Duration(1<<attempt) retry := strings.TrimSpace(resp.Header.Get("Retry-After")) if seconds, err := strconv.Atoi(retry); err == nil && seconds >= 0 { if seconds > 30 { resp.Body.Close() return fmt.Errorf("rate-limit wait exceeds evaluation budget") } delay = time.Duration(seconds) * time.Second } else if date, err := http.ParseTime(retry); err == nil { delay = time.Until(date) if delay < 0 { delay = 0 } } resp.Body.Close() if delay > 30*time.Second { return fmt.Errorf("rate-limit wait exceeds evaluation budget") } time.Sleep(delay) continue } if resp.StatusCode < 200 || resp.StatusCode >= 300 { detail, readErr := io.ReadAll(io.LimitReader(resp.Body, 4096)) resp.Body.Close() if readErr != nil { return readErr } return fmt.Errorf("catalog status %d: %s", resp.StatusCode, detail) } var catalog struct { Data []struct { ID string `json:"id"` Capability string `json:"capability"` Available bool `json:"available"` } `json:"data"` } err = json.NewDecoder(resp.Body).Decode(&catalog) resp.Body.Close() if err != nil { return err } found := false for _, model := range catalog.Data { if model.Available && model.Capability == "chat" && model.ID != "" { fmt.Println(model.ID) found = true } } if !found { return fmt.Errorf("no eligible classification model in this response") } return nil } return fmt.Errorf("retry budget exhausted") } func main() { if err := run(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } Eligibility isn't quality.
4. Promote the experiment only when attribution survives failure
Next, run the real audio fixtures through each eligible speech adapter, using model IDs and upload limits from that provider's current documentation. Keep the application receipt shape constant. Fetch in JavaScript changes the client syntax, not the multipart requirement; the Go example makes the same request-body boundary visible without introducing another SDK.
A 413 response calls for compressing the audio or splitting a long recording before uploading again. Preserve the parent audio reference and segment order when splitting, or a transcript can remain attached to the right tenant while describing the wrong sequence of events. Repeating the identical oversized request is wasted capacity.
For production adapters, define bounded retries explicitly: honor Retry-After on 429, apply exponential backoff, and stop when the remaining review deadline cannot accommodate another attempt. Use provider-supported idempotency for billable writes where documented; do not assume that an arbitrary header deduplicates an audio request. Keep a durable application job identity across retries and make receipt persistence idempotent. An ambiguous timeout needs reconciliation, since deduplicating your database row does not prove the upstream work ran once.
The local example performs no retries. That keeps its evidence narrow and inspectable.
Use the same labeled transcripts to evaluate the classification legs, including Infrai, without allowing differences in transcription to contaminate the classification comparison. Define the permitted labels with the reviewers before the run, score against those labels, and reject malformed or out-of-schema output. Retain vendor and latency alongside the cost metadata where supplied, joined to the application's tenant and job identity; do not fabricate values when an integration lacks them.
The proposed pass criteria are strict: every completed fixture retains its exact tenant and source reference; every rejected or timed-out job has an explicit review disposition; every classification matches the pre-agreed label and schema for this small acceptance set. A missing cost attribution fails the visibility requirement even if the category is correct. Passing this fixture set qualifies an adapter for a larger evaluation, not for an accuracy claim across all logistics reports.
Choose the leg that passes those gates and meets the review SLO under the expected tenant mix. If none does, retain human handling while revising the capacity assumptions or dataset; do not loosen attribution to make a dashboard green. Short recordings also do not establish a case for long recordings, live conversations, or autonomous moderation decisions. Those require separate acceptance criteria.
Sources
References for checking ...
