Skip to main content
Build a mobile app that records a voice note, displays its transcript, and lets the user reopen it from their history. The mobile client records audio and renders the interface. Backapp handles device sessions, file storage, transcription jobs, and usage limits. You can add summaries with Text to Text and paid access with RevenueCat or Adapty.

1. Configure the app and plans

In the Backapp management panel, select your app under Apps. Add speech_to_text to Allowed operations and add text_to_text if you offer summaries. Preserve any existing operations. In App credentials, activate an OpenAI credential for the app. In Plans, configure your allowances: Backapp prorates percentage allowances using the recorded subscription period. The paid Plan applies across the app, including any enabled summary calls. The allowance is based on recorded estimated provider spend. Provider charges accrue to the account behind the configured credential. For a fixed $4.50 monthly allowance regardless of subscription price, use fixed USD per period. See App settings and usage limits. Choose File retention hours for source audio and Job retention days for saved transcripts. Give the recording enough time to survive upload, queueing, and any eligible retry. Set job retention to match how long users should see notes in their history. File retention · Job retention

2. Start a session on app launch

Recover the saved session at launch. Register on first launch or when a new session is needed. Generate a stable, random installation ID, such as a UUID, and save it in secure device storage. If the app supplies its own unique ID, it goes in the same device_id field (up to 128 characters). Use a high-entropy opaque value because Backapp uses it to recover the account. Keep it stable across launches and out of logs. The curl examples use Bash and jq. Set BACKAPP_APP_KEY, BACKAPP_APP_VERSION, and BACKAPP_DEVICE_ID for your test installation. Run the snippets in the same shell.
Store the returned access and refresh tokens securely. On access token expiry, call POST /v2/auth/refresh and replace the stored token pair. Use the same Backapp account and AppKey for upload, transcription, and history. A new installation ID can produce a new account and an empty history. See Authentication.

3. Connect subscriptions (optional)

If you sell subscriptions, pass the Backapp user_id to your purchase SDK before purchase or restore. Configure the webhook for the same app and environment, then verify a sandbox purchase. Follow the RevenueCat setup or Adapty setup. After a purchase or restore, read GET /v2/me to confirm Backapp has received the new subscription state. Webhook delivery is asynchronous, so allow a short wait and recheck if the purchase succeeds but Backapp still shows the old state.

4. Record, upload, and submit

Record after the user grants microphone permission. Finalize the recording locally before uploading. Speech to Text accepts MP3, M4A, or WAV, up to 22 MiB and 10 minutes per recording. This example uses note.m4a.
Keep the returned file_id and check expires_at before submitting. Send the ID to the transcription endpoint.
HTTP 202 means Backapp accepted the submission and returned a job. Persist its job_id so the app can resume after a restart. If the response was lost, submit the same eligible file_id to recover the existing job while it exists and submission checks pass. If submission returns HTTP 402 quota_exceeded, explain the allowance and offer an upgrade if available. For HTTP 429 too_many_active_jobs, wait for an active job to finish before submitting again. See Speech to Text for full responses.

5. Display the transcript

Read the job with the persisted ID.
While the app is in the foreground, start with a one-second interval between status checks while the job is pending or processing. Keep one request in flight, slow down if the job takes longer, and pause polling when the app goes into the background. Resume from the saved job ID when the app returns. On completed, render result.text. On failed, stop polling and show an error. Offer a job retry when error.retryable is true. If the job returns HTTP 404, it may have expired or been deleted. Keep the source audio available until processing finishes.

6. Show note history

Use completed transcription jobs as the read-only note history. Render created_at and a preview of result.text for each row. Use job_id to open the full transcript.
Results are newest first and scoped to the current app and user. If next_cursor is a non-null string, repeat the same request with --data-urlencode "cursor=$BACKAPP_NEXT_CURSOR" after assigning the returned value to BACKAPP_NEXT_CURSOR. A null cursor marks the last page. History follows job retention, independently of source audio retention. For editable titles, tags, or links between notes and summaries, keep that metadata in the client for an installation-local experience.

7. Add an AI summary (optional)

When the user asks for a summary, select an available model from GET /v2/texts/models and assign its ID to BACKAPP_MODEL_ID. This example reads the completed transcript and generates a short summary in the request.
If status is completed, display result.text. If result.truncated is true, the summary may be incomplete. For longer work, use POST /v2/texts/generations and poll its job. Save the summary job ID against the transcription job ID in the client if you want to reopen the summary from a note. See Text to Text.