Public API policy
This document defines what downstream repositories may rely on under semantic versioning.
Stable (semver-guaranteed)
These symbols and their documented behaviors are stable within a major version:
doctranslate.api— symbols indoctranslate.api.__all__, including:translate,async_translate,validate_request,inspect_inputbuild_translators,resolve_openai_api_key,TranslatorBuildResultTranslationConfig,TranslateResult(legacy runtime types)TranslationRequest,TranslationResult,PUBLIC_SCHEMA_VERSIONdoctranslate.schemas— Pydantic models and enums re-exported fromdoctranslate.schemas.__all__, including:TranslationRequest,TranslationResult,TranslationOptions,TranslatorRequestConfig- Progress / CLI helper types:
progress_event_from_dict,CliProgressLine,CliJsonEnvelope - Router/TOML types:
NestedTranslatorConfig, helpers such asload_nested_translator_config - Schema versions — constants
PUBLIC_SCHEMA_VERSIONandPROGRESS_EVENT_VERSIONindoctranslate.schemas.versions.
Breaking changes (major bump)
- Removing or renaming any symbol in the stable lists above.
- Changing required fields or enum values on public Pydantic models.
- Changing the meaning of progress event
typevalues or removingschema_version/event_versionfrom emitted events. - Changing the JSON envelope shape for
--output-format json(top-level keys documented for CLI).
Non-breaking (minor / patch)
- Adding optional fields to public Pydantic models.
- Adding new optional CLI flags.
- Adding new
ArtifactKindvalues (consumers should tolerate unknown kinds).
Internal (not semver-stable)
Do not import these for product integrations:
doctranslate.format.*(includingdoctranslate.format.pdf.high_levelexcept viadoctranslate.api/doctranslate.engineshims).doctranslate.progress_monitor,doctranslate.asynchronize, provider-specific modules.- IL dataclasses under
doctranslate.format.pdf.document_ilexcept through documented extension points.
Deep imports may continue to work but can change in minor releases.
Compatibility shims (deprecated)
doctranslate.engine— re-exports pipeline entrypoints; preferdoctranslate.api.doctranslate.pdf— re-exports PDF pipeline; preferdoctranslate.api.
Experimental
doctranslate.experimental— no stability guarantees; do not rely on it from external services.
Schema versioning
PUBLIC_SCHEMA_VERSIONapplies toTranslationRequest,TranslationResult, and CLI JSON envelopes.PROGRESS_EVENT_VERSIONapplies to streaming progress objects normalized byprogress_event_from_dict.
Clients should reject unknown major schema versions when strict compatibility is required.
HTTP API wire contract (OpenAPI)
The optional FastAPI service under /v1 documents JSON shapes via OpenAPI (/openapi.json). This is separate from doctranslate.schemas semver: HTTP-only envelopes and fields live in doctranslate.http_api.models.
- Errors: JSON error responses on
/v1/*business failures use theApiErrorEnvelopeshape (ok: false,schema_version, optionalrequest_id, structurederrorwithcode,message,retryable, optionaldetails). - Progress events:
GET /v1/jobs/{id}/eventsreturnseventobjects aligned withPROGRESS_EVENT_VERSION/ theProgressEventdiscriminated union indoctranslate.schemas.public_api. - Artifacts:
ArtifactKindvalues follow the public enum; treat unknown kinds as forward-compatible. - OpenAPI artifact:
openapi/dist/openapi.jsonis exported for CI and for the generated Python client (clients/http-python/).