AI Glot websiteOpen AI Glot
VertalingenEen vertaling maken
batches

Een vertaling maken

Create a translation using exactly one source: JSON content for verbatim UTF-8 text, JSON file_url for an HTTPS download without redirects, JSON upload_id for a completed temporary upload on this same credential, or multipart/form-data with a file field for local bytes that are binary, not UTF-8, or over 1 MB. Omit filename with upload_id; the session already owns its name. Repeating an upload_id returns the existing batch without changing its instruction. Send an Idempotency-Key header (any 1 to 255 printable characters, a UUID is fine) on the other sources to make a retry after a lost response safe: a repeat returns the batch the first attempt created, without fetching or storing the file or planning again, and the same key with different content is refused with 409 idempotency_key_reused. Otherwise filename is optional and inferred if absent. Include instruction to receive the verified plan, measured counts, credit cost and extraction preview; omit it to receive suggested_instructions. Check plan.not_included before approval. Creating and planning cost no credits. Per-format limits are on GET /v1/account. The translation appears in the web app.

POST/v1/batches

Hiervoor is batches:create vereist. Een vertaling maken kost niets: credits worden pas gereserveerd wanneer je een plan goedkeurt.

Een manier kiezen om het bestand te versturen

Kies de transportmethode die past bij de locatie van het document en de mogelijkheden van je client.

TransportGebruik voorOpmerkingen
JSON met upload_idEen lokaal bestand dat via een tijdelijke uploadsessie wordt verstuurdGebruik dezelfde inloggegevens als voor het aanmaken van de sessie. Laat filename weg. Als je de vertaling opnieuw aanmaakt, krijg je de bestaande vertaling terug zonder dat de instructie wordt gewijzigd.
JSON met contentElk tekstformaatHet bestand zelf als UTF-8-tekst. De eenvoudigste optie voor een agent die de inhoud al in het geheugen heeft.
JSON met file_urlEen bestand dat al ergens is gehostAlleen HTTPS; het bestand wordt aan de serverzijde opgehaald. Er worden geen omleidingen gevolgd, dus geef de definitieve URL op.
multipart/form-dataLokale binaire bestanden, waaronder XLSX, DOCX, PPTX, PDF, IDML en ZIPVerstuur de oorspronkelijke bytes in het veld file. Dit is de transportmethode voor lokale bestanden van de CLI.

filename is optioneel, maar het is verstandig om deze mee te sturen. De extensie bepaalt hoe het formaat wordt herkend. Zo worden identieke bytes met de naam strings.xml en export.csv door verschillende parsers verwerkt.

Veilig opnieuw proberen

Stuur een Idempotency-Key-header mee (1 tot 255 afdrukbare tekens; een UUID is een goede keuze). Als een antwoord verloren gaat, levert een nieuwe poging dan de vertaling op die bij de eerste poging is aangemaakt, in plaats van een tweede vertaling. Een herhaalde aanvraag wordt afgehandeld voordat het bestand wordt opgehaald of opgeslagen en leidt niet opnieuw tot een plan, dus kost niets. De sleutel is gekoppeld aan wat je hebt verstuurd: als je dezelfde sleutel gebruikt met een ander bestand, een andere naam of een andere instructie, wordt de aanvraag geweigerd met idempotency_key_reused. Gebruik voor nieuw werk een nieuwe sleutel. Als headers niet beschikbaar zijn (MCP-tools, Code Mode), geef je idempotency_key mee in de body. Een aanvraag met een instruction retourneert plan_revision met het plan. Geef deze waarde door als expected_plan_revision wanneer je het plan goedkeurt.

Wat gebeurt er daarna?

De response bevat een id, dat je in volgende paden gebruikt als batch_id. Daarna is de volgorde altijd hetzelfde:

  1. POST /v1/batches/{batch_id}/plan: beschrijf in je eigen woorden wat er vertaald moet worden.
  2. POST /v1/batches/{batch_id}/approve: gebruik credits en start de vertaling.
  3. GET /v1/batches/{batch_id}: controleer de status totdat de vertaling klaar is.
  4. GET /v1/batches/{batch_id}/result: haal het resultaat op. Dit retourneert een ondertekende link, niet het bestand zelf.

Autorisaties

Authorizationbearerin headerrequired

Body

application/jsonrequired
upload_idstring<uuid>pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

A completed temporary upload created by this same credential. Mutually exclusive with content and file_url.

file_urlstring<uri>length: ≤ 2000 chars
contentstringlength: ≥ 1 chars
filenamestringlength: 1–200 charspattern: ^[^\/]+$
instructionstringlength: 1–2000 chars
idempotency_keystringlength: 1–255 chars

Names this attempt so a retry after a lost response returns the batch the first attempt created instead of making a second one (and planning twice). 1 to 255 printable ASCII characters. Equivalent to the Idempotency-Key header, which takes precedence; use this field where headers are not available (MCP tools, Code Mode). A repeat is answered before any file is fetched or stored. The key is bound to what was sent (file, name and instruction): the same key with different content is refused with 409 idempotency_key_reused. Use a new key for new work.

Antwoord

application/json

Create a translation from a file

dataobjectrequired
request_idstringrequired

Use these docs with your AI tools

An AI agent can read this documentation directly. You do not need an account or an API key. Everything here is public and read-only.

Query these docs via MCP

Recommended

Add this server to Claude, Claude Code, Cursor, Mistral, or any tool that supports MCP. Your agent can then search AI Glot Docs documentation and read it in full, instead of answering from memory.

https://ai-glot.com/docs/mcp
  • searchFind the passages that answer a question.
  • fetchRead one page in full, as Markdown.
  • list_pagesSee every page in this documentation.

Query these docs over HTTP

The same tools also work as plain web requests. Use this for scripts, or for any tool that does not support MCP. There is one endpoint per tool. Arguments go in the query string, and the answer comes back as JSON.

https://ai-glot.com/docs/api/docs/search?query=custom+domain

Read the OpenAPI description. It is built from the same definitions as the tools, so it always matches what the endpoints do.

Read these docs as Markdown

Add .md to any page URL to get its Markdown source. You can also send the headerAccept: text/markdown to the page URL itself.

To read the whole documentation in one file, open llms-full.txt. For a short index of every page, open llms.txt.