Skip to main content
These examples are for existing integrations using the original /api/ routes. Use the API origin assigned to your existing application and its legacy access token. For a new app using api.backapp.dev, start with the v2 image effects guide.

Prepare your connection

Set LEGACY_API_ORIGIN to the origin assigned to your app, without a trailing slash or /api. Set LEGACY_ACCESS_TOKEN to its legacy session token. If your app already uses device sign-in, its POST /api/user/device_id request accepts JSON with device_id and returns the token in accessToken. Continue using the same identity as your integration so the token can access its existing uploads and tasks. The examples use curl and jq. Provider-backed operations can incur charges.

Transcribe audio

Upload a short audio fixture using a unique file name. This example sends the complete file in one chunk. Byte offsets are measured on the original file before base64 encoding.
Request transcription after the upload succeeds.
The first request can return HTTP 202 when it queues the work. Use the same file name and language in a subsequent request on the same route to read title and content. Content can be empty while processing. Wait between checks and stop after a bounded wait.

Convert text to speech

The start request returns HTTP 202. Check the task with the same user’s token.
Read output_path when the task completes. On failure, inspect error_message.

Identify a postage stamp

Upload a stamp image as multipart data. The queued endpoint accepts an optional text field with OCR text and an optional language field that defaults to en.
The submit request returns HTTP 202. Check again after a delay while the task is pending or processing. A completed task can include stamp details and market listings. This workflow is designed for postage stamps.

Translate text

The response contains the translated text in content.

Ask the note assistant

For a follow-up question, supply the returned response_id as previous_response_id.

Summarize text

The response is synchronous and contains title, content, and emoji. Short inputs can be returned as-is in content.

Compare two images

Both images are required. The default comparison round is visual, and the response includes a difference string.