Crea una traduzione
Send the file one of three ways: JSON with content (the file itself as UTF-8 text — text formats only, the simplest path for agents), JSON with file_url (HTTPS, fetched server-side, no redirects), or multipart/form-data with a file field (required for XLSX and ZIP). filename is optional: if omitted, a clean default name is generated and the format is inferred automatically from the content. Include instruction to get the full trust-gated plan back in the same response (takes some seconds); omit it to receive four grounded suggested_instructions and continue with the plan endpoint. Quality is chosen at approval, not here — the plan quotes both tiers. Per-format size limits are on /v1/account as entitlements.max_upload_bytes_by_format. The upload also appears in the web app.
POST/v1/batches
Richiede batches:create. Creare una traduzione non costa nulla: i crediti vengono riservati solo quando approvi un piano.
Scegliere come inviare il file
Sono disponibili tre metodi di invio, e la scelta corretta dipende dal formato e non dalle preferenze.
| Metodo di invio | Utilizzo | Note |
|---|---|---|
JSON con content | Qualsiasi formato di testo | Il file stesso come testo UTF-8. La soluzione più semplice per un agente che ha già il contenuto in memoria. |
JSON con file_url | Un file già ospitato | Solo HTTPS, recuperato lato server. I reindirizzamenti non vengono seguiti, quindi fornisci l’URL finale. |
multipart/form-data | XLSX e ZIP | Obbligatorio per i formati binari: non possono essere inviati come testo JSON. |
filename è facoltativo ma consigliato. L’estensione determina l’identificazione del formato, quindi un nome come strings.xml e uno come export.csv faranno intervenire parser diversi su byte identici.
Cosa succede dopo
La risposta restituisce un batch_id. Da qui la sequenza è sempre la stessa:
POST /v1/batches/{batch_id}/plan: descrivi cosa tradurre, con parole tue.POST /v1/batches/{batch_id}/approve: scala i crediti e avvia la traduzione.GET /v1/batches/{batch_id}: effettua il polling fino al completamento.GET /v1/batches/{batch_id}/result: recupera il risultato. Restituisce un link firmato, non il file vero e proprio.