Skip to main content

Submit a translation via API

This walks through one AI translation from start to finish, using curl. Every path is relative to the base URL https://api.taia.io/api/public/v1. The full list of endpoints is in the API reference.

Before you start​

  • An API key. Your plan needs API access (Pro).
  • A file in a supported format. GET /supported-files lists them, and doesn't need a key.

Keep the key in an environment variable so it stays out of your shell history:

export TAIA_KEY="taia_pk_live_YOUR_KEY"
export TAIA_API="https://api.taia.io/api/public/v1"

1. Create the project​

Upload the file with the languages you want. Language codes are the full ones from GET /languages, such as en-US and de-DE.

curl -X POST "$TAIA_API/projects" \
-H "Authorization: Api-Key $TAIA_KEY" \
-F "project_name=Product manual" \
-F "source_language=en-US" \
-F "target_languages=de-DE,fr-FR" \
-F "files[]=@manual.docx"

The reply is 202 with a project_id. Taia starts converting the file by itself.

2. Wait until it is converted​

curl "$TAIA_API/projects/PROJECT_ID/status" \
-H "Authorization: Api-Key $TAIA_KEY"

Ask again until status is converted. If it reads failed, stop polling: the file couldn't be converted. Check that it opens and is in a supported format, then create the project again, and contact support if it keeps failing. Or configure a webhook for project.converted and skip the polling.

3. Start the translation​

curl -X POST "$TAIA_API/projects/PROJECT_ID/instant-mt" \
-H "Authorization: Api-Key $TAIA_KEY"

This uses the basic engine unless you chose another when you created the project. To pick one for this run, send {"translation_engine": "claude-sonnet"} as a JSON body with a Content-Type: application/json header. GET /translation-models lists the engines and what each costs in credits per word.

A 202 means the translation has started. A 400 whose error field reads Not enough credits for translation means your credits don't cover the job. Top up, then contact support with the project ID so we can reset it, because a project that hit this can't be restarted from the API yet.

4. Wait, then download​

Poll the status until it reads completed (or wait for the project.mt_completed webhook). If it reads failed, stop polling: the translation didn't finish. Contact support with the project ID. Once it is completed, ask for the files:

curl "$TAIA_API/projects/PROJECT_ID/final-files" \
-H "Authorization: Api-Key $TAIA_KEY"

The reply lists final_files (if it comes back without them, the files aren't ready, so check the status again), each with a name and a file_path. The file_path is a temporary download link, so fetch it right away.

Ordering professional translation instead​

For a professional translation, the steps after conversion are different: get a quote, choose service levels and a delivery date, then place the order. See Professional translation in the API reference.