1. Get a key
API v2 signs in with client credentials and trades them for a token. API v3 takes an API key on every request, and there is no token to fetch or refresh:invalid_token on v3.
Create the key in the web app, as Authentication describes. Three choices matter when you come from v2:
- The workspace. A key works in one workspace. Projects made through v2 are in the default workspace of the account that owns the v2 credentials, so create the key there to keep working with them.
- The access. An integration that creates and dubs projects needs a key that can spend: the preset “Full access”, or your own
set of scopes with
credits:spend. - The limits. A key that can spend gets monthly caps unless you choose “no limit”, and it must expire, after a year at most. API v2 credentials have neither, so size the caps for your volume and plan to replace the key before it expires.
2. Replace each method
API v3 has 82 operations against the 23 methods above. What v2 could not do at all is in Capabilities: voice
clones, on-screen text, exports, copies into more languages, transcript versions, usage, and more.
3. What behaves differently
- Long work is a job. Creating a project, dubbing and lip-sync answer at once with a job, and you wait for the job instead of reading the project until its status changes. See Jobs.
- You name the price before you pay it. Every operation that spends has an estimate, and the spending request carries
expected_cost_minutes. A price above it answers 409cost_changedand charges nothing. See Pricing. - The text of a new project is closed until its dub is charged. A project created through v3 dubs by itself after translation, and its transcript, segments and subtitles open with that charge. See Paid text.
- A retry is safe. A request that creates, edits or starts something takes an
Idempotency-Key, and repeating it with the same key does the work once. See Idempotency. - Errors have a code to branch on. Every error is
application/problem+jsonwith a stablecode, listed in Errors. - Lists page by cursor, and no request takes a workspace id. See Conventions.
4. Projects made through v2
A v3 key sees them when it belongs to their workspace, which is the default workspace of the account that owns the v2 credentials. A key of any other workspace gets 404project_not_found.
On such a project:
- The text is open. Paid text closes only projects created through v3. A copy you make of it through v3 is a v3 project, so Paid text applies to the copy.
- Everything else works as on any project: reading and editing segments, dubbing again, lip-sync, exports, downloads and copies into more languages. Work ordered through v3 is priced by its estimate.
- Work started in v2 has no job. While it runs, getProject shows it in
processing_state, andactive_jobslists only jobs started through v3. - Its media cannot be reused.
source_media_idof such a project answers 404media_not_foundon getMedia and on createProject. For another language, use createProjectCopies, or upload the file again.