diff --git a/docs/openapi.yaml b/docs/openapi.yaml index 123db6af67..f4cfd804ca 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -6844,7 +6844,8 @@ paths: and response shape). Accepts a JSON body referencing a document/image and returns extracted text. `model` selects the provider via a `provider/model` prefix (e.g. `mistral/mistral-ocr-latest`, - `azure-document-intelligence/prebuilt-read`); a bare model id (e.g. + `azure-document-intelligence/prebuilt-read`, + `vertex-deepseek-ocr/deepseek-ocr-maas`); a bare model id (e.g. `mistral-ocr-latest`) resolves to its registered provider, and an omitted `model` defaults to Mistral. Azure Document Intelligence is asynchronous upstream — the handler polls the returned operation @@ -6865,7 +6866,8 @@ paths: description: >- `provider/model` id or bare model id. Registered ids: `mistral/mistral-ocr-latest`, - `azure-document-intelligence/prebuilt-read`. Defaults to + `azure-document-intelligence/prebuilt-read`, + `vertex-deepseek-ocr/deepseek-ocr-maas`. Defaults to `mistral-ocr-latest` when omitted. document: type: object diff --git a/docs/reference/API_REFERENCE.md b/docs/reference/API_REFERENCE.md index f1d4fce2e9..9ccca26093 100644 --- a/docs/reference/API_REFERENCE.md +++ b/docs/reference/API_REFERENCE.md @@ -220,12 +220,13 @@ Content-Type: application/json `mistral-ocr-latest`) resolves to its registered provider, and an omitted `model` defaults to Mistral (`mistral-ocr-latest`). Registered providers (`open-sse/config/ocrRegistry.ts`): -| Provider id | Model id | `model` value | Notes | -| ----------------------------- | -------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------ | -| `mistral` | `mistral-ocr-latest` | `mistral/mistral-ocr-latest` (or bare `mistral-ocr-latest`) | Synchronous — the response is returned directly from the single upstream call. | -| `azure-document-intelligence` | `prebuilt-read` | `azure-document-intelligence/prebuilt-read` | Asynchronous upstream (`analyze` + poll) — see below. | +| Provider id | Model id | `model` value | Notes | +| ----------------------------- | -------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `mistral` | `mistral-ocr-latest` | `mistral/mistral-ocr-latest` (or bare `mistral-ocr-latest`) | Synchronous — the response is returned directly from the single upstream call. | +| `azure-document-intelligence` | `prebuilt-read` | `azure-document-intelligence/prebuilt-read` | Asynchronous upstream (`analyze` + poll) — see below. | +| `vertex-deepseek-ocr` | `deepseek-ocr-maas` | `vertex-deepseek-ocr/deepseek-ocr-maas` | Synchronous, via Vertex AI's `openapi/chat/completions` partner endpoint — see below for auth/URL. | -Both providers respond in the same Mistral-shaped body: +All three providers respond in the same Mistral-shaped body: ```json { @@ -245,6 +246,19 @@ operation is still running after the attempt budget is exhausted. The final Azur normalized into the same `pages`/`markdown` shape used by Mistral before being returned to the caller, so client code does not need to special-case the provider. +### Vertex AI DeepSeek OCR auth and endpoint resolution + +`vertex-deepseek-ocr` reuses the same Vertex AI authentication OmniRoute already supports for +chat/image traffic (`open-sse/executors/vertex.ts`): the connection's API key is either a +Service Account JSON credential (exchanged for a short-lived OAuth access token via the JWT-bearer +flow) or an already-minted OAuth access token used as-is. The upstream endpoint URL is Vertex's +generic `openapi/chat/completions` partner endpoint, built from the connection's project and +region — an explicit `providerSpecificData.project`/`providerSpecificData.region` always wins; +otherwise the project is derived from the Service Account JSON's `project_id` and the region +defaults to `us-central1`. Both resolutions happen in `open-sse/handlers/ocr.ts` +(`resolveVertexOcrAccessToken`, `resolveVertexOcrBaseUrl`), consumed by +`src/app/api/v1/ocr/route.ts` before dispatching to `handleOcr`. + --- ## List Models